X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=blobdiff_plain;f=impatomic.cc;h=571789d662f154e109025e23c6d09ac89f998692;hp=8642bee26c63011a112951d72a84bc1d7ed08bc6;hb=4159ba45e83f6542e3a3320e83bca9fbaf2da3ea;hpb=b6db821be4ff9af669ff596a37d144006f6bbdaf diff --git a/impatomic.cc b/impatomic.cc index 8642bee2..571789d6 100644 --- a/impatomic.cc +++ b/impatomic.cc @@ -1,12 +1,13 @@ #include "impatomic.h" #include "common.h" #include "model.h" +#include "threads-model.h" namespace std { bool atomic_flag_test_and_set_explicit ( volatile atomic_flag * __a__, memory_order __x__ ) { volatile bool * __p__ = &((__a__)->__f__); - model->switch_to_master(new ModelAction(ATOMIC_READ, __x__, (void *) __p__)); + model->switch_to_master(new ModelAction(ATOMIC_RMWR, __x__, (void *) __p__)); bool result = (bool) thread_current()->get_return_value(); model->switch_to_master(new ModelAction(ATOMIC_RMW, __x__, (void *) __p__, true)); return result; @@ -25,11 +26,6 @@ void atomic_flag_clear_explicit void atomic_flag_clear( volatile atomic_flag* __a__ ) { atomic_flag_clear_explicit( __a__, memory_order_seq_cst ); } -void atomic_flag_fence( const volatile atomic_flag* __a__, memory_order __x__ ) -{ - ASSERT(0); -} - void __atomic_flag_wait__( volatile atomic_flag* __a__ ) { while ( atomic_flag_test_and_set( __a__ ) ); }