]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: threads: make threads_{harmless|want_rdv}_mask constant 0 without threads
authorWilly Tarreau <w@1wt.eu>
Wed, 22 May 2019 05:48:18 +0000 (07:48 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 22 May 2019 09:50:48 +0000 (11:50 +0200)
Some code starts to add ifdefs everywhere to work around the lack of
threads_harmless_mask when threads are not compiled in. This one is
often used to indicate a thread having joined the rendez-vous point or
a thread sleeping in the poller. By setting it to zero we translate
what usually is required in debugging code (i.e. the only thread is
currently working) and for signal handlers we can use a combination of
threads_harmless_mask and sleeping_threads_mask to detect the polling
cases as well. Similarly do the same with threads_want_rdv_mask which
is less often used though.

include/common/hathreads.h

index 1042c26b6836926f13599c56a9c15764bc3a917e..0bc6e4505e3fd599926b7b197f7f7d6139a8df30 100644 (file)
@@ -46,6 +46,8 @@
  * at build time.
  */
 enum { all_threads_mask = 1UL };
+enum { threads_harmless_mask = 0 };
+enum { threads_want_rdv_mask = 0 };
 enum { tid_bit = 1UL };
 enum { tid = 0 };