ProcessingEventsWhileBlocked is relevant only to the current thread

Former-commit-id: b400be68b7a45e73ea851c11dfee3fdcbacb4794
This commit is contained in:
John Sully 2021-05-29 01:08:43 +00:00
parent 1d0378e0dc
commit bf77b1a03a
2 changed files with 2 additions and 2 deletions

View File

@ -40,7 +40,7 @@
#include "aelocker.h"
static void setProtocolError(const char *errstr, client *c);
std::atomic<int> 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

View File

@ -2471,7 +2471,7 @@ void whileBlockedCron() {
latencyAddSampleIfNeeded("while-blocked-cron",latency);
}
extern std::atomic<int> 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