Debug sleep should apply to all threads
Former-commit-id: 41b678814b2c2ff93935b57e630028aaf2e9ae62
This commit is contained in:
parent
93844525ea
commit
b8cc7e2b9c
@ -595,9 +595,19 @@ NULL
|
|||||||
double dtime = strtod(szFromObj(c->argv[2]),NULL);
|
double dtime = strtod(szFromObj(c->argv[2]),NULL);
|
||||||
long long utime = dtime*1000000;
|
long long utime = dtime*1000000;
|
||||||
struct timespec tv;
|
struct timespec tv;
|
||||||
|
|
||||||
tv.tv_sec = utime / 1000000;
|
tv.tv_sec = utime / 1000000;
|
||||||
tv.tv_nsec = (utime % 1000000) * 1000;
|
tv.tv_nsec = (utime % 1000000) * 1000;
|
||||||
|
|
||||||
|
// Ensure all threads sleep
|
||||||
|
for (int iel = 0; iel < cserver.cthreads; ++iel)
|
||||||
|
{
|
||||||
|
if (iel == ielFromEventLoop(serverTL->el))
|
||||||
|
continue; // we will sleep ourselves below
|
||||||
|
aePostFunction(g_pserver->rgthreadvar[iel].el, [tv]{
|
||||||
|
nanosleep(&tv, NULL);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
nanosleep(&tv, NULL);
|
nanosleep(&tv, NULL);
|
||||||
addReply(c,shared.ok);
|
addReply(c,shared.ok);
|
||||||
} else if (!strcasecmp(szFromObj(c->argv[1]),"set-active-expire") &&
|
} else if (!strcasecmp(szFromObj(c->argv[1]),"set-active-expire") &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user