File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ class QueueSpinLock final {
14
14
public:
15
15
explicit Guard (QueueSpinLock& host) : host(host) { host.Acquire (this ); }
16
16
~Guard () {
17
- if (is_owner.load ()) Release ();
17
+ if (is_owner.load (std::memory_order_release )) Release ();
18
18
}
19
19
20
20
void Release () {
@@ -24,13 +24,13 @@ class QueueSpinLock final {
24
24
25
25
void SetOwner () { is_owner.store (true , std::memory_order_release); }
26
26
27
- void SetNext (Guard* guard) { next.store (guard); }
27
+ void SetNext (Guard* guard) { next.store (guard, std::memory_order_release ); }
28
28
29
29
bool IsOwner () const {
30
30
return is_owner.load (std::memory_order_acquire);
31
31
}
32
32
33
- bool HasNext () const { return next.load () != nullptr ; }
33
+ bool HasNext () const { return next.load (std::memory_order_acquire ) != nullptr ; }
34
34
35
35
void SetNextOwner () { next.load ()->SetOwner (); }
36
36
@@ -60,8 +60,8 @@ class QueueSpinLock final {
60
60
}
61
61
62
62
Guard* old_guard = guard;
63
- while (!tail_.compare_exchange_weak (old_guard, nullptr ,
64
- std::memory_order_release)) {
63
+ while (!tail_.compare_exchange_weak (old_guard, nullptr /* ,
64
+ std::memory_order_release*/ )) {
65
65
if (guard->HasNext ()) {
66
66
guard->SetNextOwner ();
67
67
return ;
You can’t perform that action at this time.
0 commit comments