bustus_primus
bustus_primus

Reputation: 61

Critical section control with atomics

For some reason I got in my head that

if (someAtomicBool) return;
someAtomicBool = false;

Is adequate control for a critical section. This is not the case, right? I think the correct way to do this and achieve the functionality I'm looking for is to check if a mutex is locked or something.

Upvotes: 0

Views: 26

Answers (0)

Related Questions