]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Use relaxed atomics to access the monitor line.
authorkib <kib@FreeBSD.org>
Tue, 24 Apr 2018 14:02:46 +0000 (14:02 +0000)
committerkib <kib@FreeBSD.org>
Tue, 24 Apr 2018 14:02:46 +0000 (14:02 +0000)
commit1bd517bdbd831f9a974e604955dff7be502e68ba
treeac96e18c4f131f16ea79ac0ac9c406cc897a0e30
parentdd08c073d029fabfe7bee9a00a2c73eb9987c8c5
Use relaxed atomics to access the monitor line.

We must ensure that accesses occur, they do not have any other
compiler-visible effects.  Bruce found some situations where
optimization could remove an access, and provided a patch to use
volatile qualifier for the state variables.  Since volatile behaviour
there is the compiler-specific interpretation of the keyword, use
relaxed atomics instead, which gives exactly the desired semantic.

Noted by and discussed with: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
sys/x86/x86/cpu_machdep.c