提交 b338f2b9 编写于 作者: A antirez

Modules TSC: Add mutex for server.lruclock.

Only useful for when no atomic builtins are available.
上级 7e9c658d
......@@ -1432,6 +1432,7 @@ void initServerConfig(void) {
server.lua_time_limit = LUA_SCRIPT_TIME_LIMIT;
unsigned int lruclock = getLRUClock();
pthread_mutex_init(&server.lruclock_mutex,NULL);
atomicSet(server.lruclock,lruclock);
resetServerSaveParams();
......
......@@ -861,6 +861,7 @@ struct redisServer {
dict *orig_commands; /* Command table before command renaming. */
aeEventLoop *el;
unsigned int lruclock; /* Clock for LRU eviction */
pthread_mutex_t lruclock_mutex;
int shutdown_asap; /* SHUTDOWN needed ASAP */
int activerehashing; /* Incremental rehash in serverCron() */
int active_defrag_running; /* Active defragmentation running (holds current scan aggressiveness) */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册