Fix: racy init_done initialization master
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 28 Sep 2024 10:57:42 +0000 (06:57 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 28 Sep 2024 10:57:42 +0000 (06:57 -0400)
commite5dcc435cc1ae3fa5f93a3b2e840e678acdf0d1d
tree39330ff8fbd26e19e9824f2043f6f28235d84f8a
parent95febd5e1d57c2d766707ddcdeeb976dfff49e60
Fix: racy init_done initialization

If init_done is set while another thread is loading its value, the other
thread can erroneously expect initialization to be complete while the
initialization is still in progress.

Set init_done after initialization with a store-release, and load it
with load-acquire outside of the mutex critical section.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Idb1345c6dcf3da7d711937bd5072527c0bf1d33a
src/rseq.c
This page took 0.023343 seconds and 4 git commands to generate.