From: bdemsky Date: Wed, 26 Jun 2019 23:19:56 +0000 (-0700) Subject: add more functions X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=72c0d3df7c506c4f2f1f6acfae87c1241e5b618e;p=c11tester.git add more functions --- diff --git a/cmodelint.cc b/cmodelint.cc index c0a46e17..b9eb214a 100644 --- a/cmodelint.cc +++ b/cmodelint.cc @@ -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 diff --git a/include/mutex.h b/include/mutex.h index e015ea59..1903a792 100644 --- a/include/mutex.h +++ b/include/mutex.h @@ -7,7 +7,6 @@ #define __CXX_MUTEX__ #include "modeltypes.h" -//#include namespace cdsc { struct mutex_state {