]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: haproxy/threads: don't check global_tasks_mask twice
authorWilly Tarreau <w@1wt.eu>
Mon, 23 Mar 2020 08:33:32 +0000 (09:33 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 23 Mar 2020 08:33:32 +0000 (09:33 +0100)
In run_thread_poll_loop() we test both for (global_tasks_mask & tid_bit)
and thread_has_tasks(), but the former is useless since this test is
already part of the latter.

src/haproxy.c

index ca0ab3270029dc2ddc3b3f01304be7e55883d219..278476c3e216120cb3cf88ceb22b0369ccf19195 100644 (file)
@@ -2819,7 +2819,7 @@ void run_poll_loop()
                else {
                        _HA_ATOMIC_OR(&sleeping_thread_mask, tid_bit);
                        __ha_barrier_atomic_store();
-                       if ((global_tasks_mask & tid_bit) || thread_has_tasks()) {
+                       if (thread_has_tasks()) {
                                activity[tid].wake_tasks++;
                                _HA_ATOMIC_AND(&sleeping_thread_mask, ~tid_bit);
                        } else