diff --git a/src/haproxy.c b/src/haproxy.c index fcba6cd22..5f56c0a36 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -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++; } }