From: Brian Norris Date: Thu, 5 Jul 2012 20:57:50 +0000 (-0700) Subject: libatomic: atomic_load() - use proper reads_from value X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=99889e745e4fc8d19e203d2be61594905cb9db33;p=cdsspec-compiler.git libatomic: atomic_load() - use proper reads_from value Finally utilize a return value from the model-checker, instead of storing/retrieving a sequentially-consistent value in obj->value. --- diff --git a/libatomic.cc b/libatomic.cc index a076533..5317319 100644 --- a/libatomic.cc +++ b/libatomic.cc @@ -11,10 +11,9 @@ void atomic_store_explicit(struct atomic_object *obj, int value, memory_order or int atomic_load_explicit(struct atomic_object *obj, memory_order order) { - int value = obj->value; DBG(); - model->switch_to_master(new ModelAction(ATOMIC_READ, order, obj, value)); - return value; + model->switch_to_master(new ModelAction(ATOMIC_READ, order, obj)); + return thread_current()->get_return_value(); } void atomic_init(struct atomic_object *obj, int value)