changes
[model-checker-benchmarks.git] / mcs-lock / mcs-lock.h
index 47c2f8f00536e06ace6da9cc668898d836fea29b..4b808f7c3c9b9bbc7effe6b4e6c570f2712e5232 100644 (file)
@@ -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,7 @@ public:
                if ( next == NULL )
                {
                        mcs_node * tail_was_me = me;
                if ( next == NULL )
                {
                        mcs_node * tail_was_me = me;
-                       if ( m_tail.compare_exchange( tail_was_me,NULL,std::mo_acq_rel) ) {
+                       if ( m_tail.compare_exchange_strong( tail_was_me,NULL,std::mo_acq_rel) ) {
                                // got null in tail, mutex is unlocked
                                return;
                        }
                                // got null in tail, mutex is unlocked
                                return;
                        }
@@ -80,7 +80,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();
                        }
                }
 
                        }
                }