X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=blobdiff_plain;f=sleeps.cc;fp=sleeps.cc;h=0528374b3ac4c2a053fd756413dcd180e8b48430;hp=0000000000000000000000000000000000000000;hb=aa653d6ec854b70b92b9cbb0fe452fbb0e300979;hpb=5881b6573197c0366e2380cf28f78189c3fde312 diff --git a/sleeps.cc b/sleeps.cc new file mode 100644 index 00000000..0528374b --- /dev/null +++ b/sleeps.cc @@ -0,0 +1,26 @@ +#include +#include + +#include "action.h" +#include "model.h" + +unsigned int __sleep (unsigned int seconds) +{ + model->switch_to_master( + new ModelAction(NOOP, std::memory_order_seq_cst, NULL) + ); + return 0; +} + +unsigned int sleep(unsigned int seconds) +{ + return __sleep(seconds); +} + +int usleep (useconds_t useconds) +{ + model->switch_to_master( + new ModelAction(NOOP, std::memory_order_seq_cst, NULL) + ); + return 0; +}