From: Willy Tarreau Date: Wed, 22 May 2019 05:48:18 +0000 (+0200) Subject: MINOR: threads: make threads_{harmless|want_rdv}_mask constant 0 without threads X-Git-Tag: v2.0-dev4~29 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=441259c5614c69c53acb09f64b59465fe165a926;p=thirdparty%2Fhaproxy.git MINOR: threads: make threads_{harmless|want_rdv}_mask constant 0 without threads 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. --- diff --git a/include/common/hathreads.h b/include/common/hathreads.h index 1042c26b68..0bc6e4505e 100644 --- a/include/common/hathreads.h +++ b/include/common/hathreads.h @@ -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 };