mirror of
https://github.com/redis/redis.git
synced 2026-06-11 09:52:05 -04:00
Lazyfree: fix lazyfreeGetPendingObjectsCount() race reading counter.
This commit is contained in:
parent
7d9326b1f3
commit
52bc74f221
1 changed files with 3 additions and 1 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue