threads_internal: pass the current 'action' to the internal thread system
[c11tester.git] / libatomic.cc
index a00838e91545b823dfddeca4ef53b7b2c575b826..dc715b2a56ae13b0d5ce8acdc25675d407fe40b6 100644 (file)
@@ -1,13 +1,14 @@
 #include "libatomic.h"
-#include "libthreads.h"
+#include "model.h"
+#include "threads_internal.h"
 
 void atomic_store_explicit(struct atomic_object *obj, int value, memory_order order)
 {
-       thread_yield();
+       thread_switch_to_master(new ModelAction(ATOMIC_WRITE, order, obj, value));
 }
 
 int atomic_load_explicit(struct atomic_object *obj, memory_order order)
 {
-       thread_yield();
+       thread_switch_to_master(new ModelAction(ATOMIC_READ, order, obj, VALUE_NONE));
        return 0;
 }