]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: threads/listeners: Make listeners thread-safe
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 30 May 2017 13:36:50 +0000 (15:36 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 31 Oct 2017 12:58:30 +0000 (13:58 +0100)
commit8d8aa0d681c001891839588c0d51fa3cc9f652c7
treef4998533b38ce01794a1ef6c5c0f373bdea62842
parentb79a94c9f3c6b741a219decfeb004896cd978795
MEDIUM: threads/listeners: Make listeners thread-safe

First, we use atomic operations to update jobs/totalconn/actconn variables,
listener's nbconn variable and listener's counters. Then we add a lock on
listeners to protect access to their information. And finally, listener queues
(global and per proxy) are also protected by a lock. Here, because access to
these queues are unusal, we use the same lock for all queues instead of a global
one for the global queue and a lock per proxy for others.
12 files changed:
include/common/buffer.h
include/common/hathreads.h
include/proto/proxy.h
include/types/listener.h
src/listener.c
src/peers.c
src/proto_http.c
src/proto_tcp.c
src/session.c
src/ssl_sock.c
src/stream.c
src/tcp_rules.c