From 72c0d3df7c506c4f2f1f6acfae87c1241e5b618e Mon Sep 17 00:00:00 2001 From: bdemsky Date: Wed, 26 Jun 2019 16:19:56 -0700 Subject: [PATCH] add more functions --- cmodelint.cc | 16 ++++------------ include/mutex.h | 1 - 2 files changed, 4 insertions(+), 13 deletions(-) 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 { -- 2.34.1