Avoid a race in init_thread_stop()
authorMatt Caswell <matt@openssl.org>
Fri, 5 Nov 2021 14:43:01 +0000 (14:43 +0000)
committerMatt Caswell <matt@openssl.org>
Fri, 12 Nov 2021 17:16:14 +0000 (17:16 +0000)
commit3b9de0c9aa791bd9e6f0534ec091accbdf15292f
tree3404f0f85f4d4b928c9bb8596d7a320b391deaea
parentc59fc87b338880893286934f02c446854f5baabf
Avoid a race in init_thread_stop()

init_thread_stop() is called when a thread is stopping. It calls all
the callbacks that need to know about the demise of this thread. However,
the list of callbacks is also available globally and may be updated by
other threads so we need to make sure we use the right lock.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16980)
crypto/initthread.c