Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
52bc74f2
Commit
52bc74f2
authored
May 04, 2017
by
antirez
Browse files
Lazyfree: fix lazyfreeGetPendingObjectsCount() race reading counter.
parent
7d9326b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lazyfree.c
View file @
52bc74f2
...
...
@@ -8,7 +8,9 @@ pthread_mutex_t lazyfree_objects_mutex = PTHREAD_MUTEX_INITIALIZER;
/* Return the number of currently pending objects to free. */
size_t
lazyfreeGetPendingObjectsCount
(
void
)
{
return
lazyfree_objects
;
size_t
aux
;
atomicGet
(
lazyfree_objects
,
aux
,
lazyfree_objects_mutex
);
return
aux
;
}
/* Return the amount of work needed in order to free an object.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment