]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: threads: Run the poll loop on the main thread too
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 27 Oct 2017 11:53:47 +0000 (13:53 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 31 Oct 2017 12:58:33 +0000 (13:58 +0100)
commitcd7879adc2c408cd607bb287318d8152eb059872
tree63da6b208905a201989e28370454b06b5dce0ec1
parente8ca434074a0a5e2319b2ced6c780f9228d07e01
BUG/MEDIUM: threads: Run the poll loop on the main thread too

There was a flaw in the way the threads was created. the main one was just used
to create all the others and just wait to exit. Now, it is used to run a poll
loop. So we only create nbthread-1 threads.

This also fixes a bug about the compression filter when there is only 1 thread
(nbthread == 1 or no threads support). The bug was in the way thread-local
resources was initialized. per-thread init/deinit callbacks were never called
for the main process. So, with nthread set to 1, some buffers remained
uninitialized.
include/common/chunk.h
src/buffer.c
src/chunk.c
src/ev_epoll.c
src/ev_kqueue.c
src/ev_poll.c
src/ev_select.c
src/fd.c
src/haproxy.c
src/log.c