提交 52bc74f2 编写于 作者: A antirez

Lazyfree: fix lazyfreeGetPendingObjectsCount() race reading counter.

上级 7d9326b1
......@@ -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.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册