projects
/
model-checker-benchmarks.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add another testcase for dekker-fences
[model-checker-benchmarks.git]
/
mcs-lock
/
mcs-lock.h
diff --git
a/mcs-lock/mcs-lock.h
b/mcs-lock/mcs-lock.h
index 2d39f2f6cab8d2aa5b10f5cd6e1b9092a818955e..70e4019f9c9046a8242341689d51b4fd0d51a85a 100644
(file)
--- a/
mcs-lock/mcs-lock.h
+++ b/
mcs-lock/mcs-lock.h
@@
-57,7
+57,7
@@
public:
// wait on predecessor setting my flag -
rl::linear_backoff bo;
while ( me->gate.load(std::mo_acquire) ) {
// wait on predecessor setting my flag -
rl::linear_backoff bo;
while ( me->gate.load(std::mo_acquire) ) {
-
bo.
yield();
+
thrd_
yield();
}
}
}
}
}
}
@@
-69,7
+69,8
@@
public:
if ( next == NULL )
{
mcs_node * tail_was_me = me;
if ( next == NULL )
{
mcs_node * tail_was_me = me;
- if ( m_tail.compare_exchange_strong( tail_was_me,NULL,std::mo_acq_rel) ) {
+ if ( m_tail.compare_exchange_strong(
+ tail_was_me,NULL,std::mo_release) ) {
// got null in tail, mutex is unlocked
return;
}
// got null in tail, mutex is unlocked
return;
}
@@
-80,7
+81,7
@@
public:
next = me->next.load(std::mo_acquire);
if ( next != NULL )
break;
next = me->next.load(std::mo_acquire);
if ( next != NULL )
break;
-
bo.
yield();
+
thrd_
yield();
}
}
}
}