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