Skip to content

Commit 9390c38

Browse files
committed
Modules TSC: Add mutex for server.lruclock.
Only useful for when no atomic builtins are available.
1 parent ece6587 commit 9390c38

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/server.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1432,6 +1432,7 @@ void initServerConfig(void) {
14321432
server.lua_time_limit = LUA_SCRIPT_TIME_LIMIT;
14331433

14341434
unsigned int lruclock = getLRUClock();
1435+
pthread_mutex_init(&server.lruclock_mutex,NULL);
14351436
atomicSet(server.lruclock,lruclock);
14361437
resetServerSaveParams();
14371438

src/server.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -861,6 +861,7 @@ struct redisServer {
861861
dict *orig_commands; /* Command table before command renaming. */
862862
aeEventLoop *el;
863863
unsigned int lruclock; /* Clock for LRU eviction */
864+
pthread_mutex_t lruclock_mutex;
864865
int shutdown_asap; /* SHUTDOWN needed ASAP */
865866
int activerehashing; /* Incremental rehash in serverCron() */
866867
int active_defrag_running; /* Active defragmentation running (holds current scan aggressiveness) */

0 commit comments

Comments
 (0)