moved time thread code to end of beforeSleep
Former-commit-id: ac1022c772c7357571829f24c87aa3dc2deade72
This commit is contained in:
parent
ce8705451a
commit
de376f6b93
@ -2514,12 +2514,6 @@ void beforeSleep(struct aeEventLoop *eventLoop) {
|
|||||||
serverAssert(g_pserver->repl_batch_offStart < 0);
|
serverAssert(g_pserver->repl_batch_offStart < 0);
|
||||||
runAndPropogateToReplicas(processClients);
|
runAndPropogateToReplicas(processClients);
|
||||||
|
|
||||||
{
|
|
||||||
std::lock_guard<std::mutex> lock(time_thread_mutex);
|
|
||||||
sleeping_threads++;
|
|
||||||
serverAssert(sleeping_threads <= cserver.cthreads);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Handle precise timeouts of blocked clients. */
|
/* Handle precise timeouts of blocked clients. */
|
||||||
handleBlockedClientsTimeout();
|
handleBlockedClientsTimeout();
|
||||||
|
|
||||||
@ -2651,6 +2645,13 @@ void beforeSleep(struct aeEventLoop *eventLoop) {
|
|||||||
locker.disarm();
|
locker.disarm();
|
||||||
if (!fSentReplies)
|
if (!fSentReplies)
|
||||||
handleClientsWithPendingWrites(iel, aof_state);
|
handleClientsWithPendingWrites(iel, aof_state);
|
||||||
|
|
||||||
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(time_thread_mutex);
|
||||||
|
sleeping_threads++;
|
||||||
|
serverAssert(sleeping_threads <= cserver.cthreads);
|
||||||
|
}
|
||||||
|
|
||||||
if (moduleCount()) moduleReleaseGIL(TRUE /*fServerThread*/);
|
if (moduleCount()) moduleReleaseGIL(TRUE /*fServerThread*/);
|
||||||
|
|
||||||
/* Do NOT add anything below moduleReleaseGIL !!! */
|
/* Do NOT add anything below moduleReleaseGIL !!! */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user