LP#1774703 Limit scope of thread locks user/berick/lp1774703-websocket-thread-lock
authorBill Erickson <berickxx@gmail.com>
Fri, 1 Jun 2018 19:44:34 +0000 (15:44 -0400)
committerBill Erickson <berickxx@gmail.com>
Fri, 1 Jun 2018 19:44:36 +0000 (15:44 -0400)
commit7dbcb8f047d79bec393aa6ce768c486f44490dfd
treece6a2b03625139d16f05e138a3995fbbb4e8df99
parent71720f639e00d0e457bc8f967f8060b579bc2882
LP#1774703 Limit scope of thread locks

Avoid thread contention issues when running this websockets code:

https://github.com/jchampio/apache-websocket

In general, the scope of the thread locking has been dimished, focused
more closely on keeping blocks of reads/writes to the shared recipient
cache running in a single thread at a time.

Thread locks have also been fully removed from the idle timeout thread.
By the time it modifies any shared data, the process is already shutting
down.

Added a few thread safety checks to avoid (the already unlikely and
maybe not even a problem) multiple translator->close() calls just to be
extra safe.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
src/gateway/osrf_websocket_translator.c