From 99889e745e4fc8d19e203d2be61594905cb9db33 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Thu, 5 Jul 2012 13:57:50 -0700 Subject: [PATCH] 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. --- libatomic.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libatomic.cc b/libatomic.cc index a0765330..53173196 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) -- 2.34.1