add more functions
authorbdemsky <bdemsky@uci.edu>
Wed, 26 Jun 2019 23:19:56 +0000 (16:19 -0700)
committerbdemsky <bdemsky@uci.edu>
Wed, 26 Jun 2019 23:19:56 +0000 (16:19 -0700)
cmodelint.cc
include/mutex.h

index c0a46e17b3f1beaf8c86872d8f4f49fb4c6a2c7c..b9eb214a5cffe4918939407a50526c28afedc925 100644 (file)
@@ -86,27 +86,19 @@ void model_fence_action(memory_order ord) {
 
 /* ---  helper functions --- */
 uint64_t model_rmwrcas_action_helper(void *obj, int atomic_index, uint64_t oldval, int size, const char *position) {
-       return model->switch_to_master(
-               new ModelAction(ATOMIC_RMWRCAS, position, orders[atomic_index], obj)
-               );
+       ensureModelValue(new ModelAction(ATOMIC_RMWRCAS, position, orders[atomic_index], obj), uint64_t);
 }
 
 uint64_t model_rmwr_action_helper(void *obj, int atomic_index, const char *position) {
-       return model->switch_to_master(
-               new ModelAction(ATOMIC_RMWR, position, orders[atomic_index], obj)
-               );
+       ensureModelValue(new ModelAction(ATOMIC_RMWR, position, orders[atomic_index], obj), uint64_t);
 }
 
 void model_rmw_action_helper(void *obj, uint64_t val, int atomic_index, const char * position) {
-       model->switch_to_master(
-               new ModelAction(ATOMIC_RMW, position, orders[atomic_index], obj, val)
-               );
+       ensureModel(new ModelAction(ATOMIC_RMW, position, orders[atomic_index], obj, val));
 }
 
 void model_rmwc_action_helper(void *obj, int atomic_index, const char *position) {
-       model->switch_to_master(
-               new ModelAction(ATOMIC_RMWC, position, orders[atomic_index], obj)
-               );
+       ensureModel(new ModelAction(ATOMIC_RMWC, position, orders[atomic_index], obj));
 }
 
 // cds atomic inits
index e015ea599f7373d59125f3eaf69fcfce7e1f3a0e..1903a792ecae6a9556269569b9bc54e09aaecc20 100644 (file)
@@ -7,7 +7,6 @@
 #define __CXX_MUTEX__
 
 #include "modeltypes.h"
-//#include <mutex>
 
 namespace cdsc {
        struct mutex_state {