]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: threads: serialize threads initialization
authorWilly Tarreau <w@1wt.eu>
Fri, 7 Jun 2019 12:41:11 +0000 (14:41 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 7 Jun 2019 13:37:47 +0000 (15:37 +0200)
commit6ec902a6590bff551f332d8a1a9b67b2dda02829
tree288b1a6d90b3683b4727f705810e7c6ba1d83ce7
parente18616168f76274861c1f0cb52ddb916043ac18d
MINOR: threads: serialize threads initialization

There is no point in initializing threads in parallel when we know that
it's the moment where some global variables are turned to thread-local
ones, and/or that some global variables are updated (like global_now or
trash_size). Some FDs might be created/destroyed/reallocated and could
be tricky to follow as well (think about epoll_fd for example).

Instead of having to be extremely careful about all these, and to trigger
false positives in thread sanitizers, let's simply initialize one thread
at a time. The init step is very fast so nobody should even notice, and
we won't have any more doubts about what might have happened when
analysing a dump.

See GH issues #111 and #117 for some background on this.
src/haproxy.c