MEDIUM: haproxy: don't use sync_poll_loop() anymore in the main loop

This partially reverts commit d8fd2af ("BUG/MEDIUM: threads: Use the sync
point to check active jobs and exit") which used to address an issue in
the way the sync point used to check for present threads, which was later
addressed by commit ddb6c16 ("BUG/MEDIUM: threads: Fix the exit condition
of the thread barrier"). Thus there is no need anymore to use the sync
point for exiting and we can completely remove this call in the main loop.
This commit is contained in:
Willy Tarreau 2018-08-02 10:54:31 +02:00
parent 3d3700f216
commit 85c459d7e8

View File

@ -2385,24 +2385,6 @@ static inline void servers_check_for_updates()
}
}
static int sync_poll_loop()
{
int stop = 0;
if (THREAD_NO_SYNC())
return stop;
THREAD_ENTER_SYNC();
if (!THREAD_NEED_SYNC())
goto exit;
exit:
stop = (jobs == 0); /* stop when there's nothing left to do */
THREAD_EXIT_SYNC();
return stop;
}
/* Runs the polling loop */
static void run_poll_loop()
{
@ -2421,10 +2403,9 @@ static void run_poll_loop()
/* Check if we can expire some tasks */
next = wake_expired_tasks();
/* the first thread requests a synchronization to exit when
* there is no active jobs anymore */
if (tid == 0 && jobs == 0)
THREAD_WANT_SYNC();
/* stop when there's nothing left to do */
if (jobs == 0)
break;
/* expire immediately if events are pending */
exp = now_ms;
@ -2453,10 +2434,6 @@ static void run_poll_loop()
/* check for server status updates */
servers_check_for_updates();
/* Synchronize all polling loops */
if (sync_poll_loop())
break;
activity[tid].loops++;
}
}