diff --git a/src/networking.cpp b/src/networking.cpp index 45d43f063..7710dd64b 100644 --- a/src/networking.cpp +++ b/src/networking.cpp @@ -40,7 +40,7 @@ #include "aelocker.h" static void setProtocolError(const char *errstr, client *c); -std::atomic ProcessingEventsWhileBlocked {0}; /* See processEventsWhileBlocked(). */ +__thread int ProcessingEventsWhileBlocked = 0; /* See processEventsWhileBlocked(). */ /* Return the size consumed from the allocator, for the specified SDS string, * including internal fragmentation. This function is used in order to compute diff --git a/src/server.cpp b/src/server.cpp index a4ba338eb..a57b449e8 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -2471,7 +2471,7 @@ void whileBlockedCron() { latencyAddSampleIfNeeded("while-blocked-cron",latency); } -extern std::atomic ProcessingEventsWhileBlocked; +extern __thread int ProcessingEventsWhileBlocked; /* This function gets called every time Redis is entering the * main loop of the event driven library, that is, before to sleep