model: get_mutex() for locating the lock map
authorBrian Norris <banorris@uci.edu>
Wed, 3 Apr 2013 00:25:04 +0000 (17:25 -0700)
committerBrian Norris <banorris@uci.edu>
Wed, 3 Apr 2013 00:25:04 +0000 (17:25 -0700)
The mutex can already be located via get_mutex(), so don't try to guess
whether it was store in the value or location fields of the ModelAction.

model.cc

index e6f9afd9c6fd1d2b904e3ea4e23777198b71561f..a18754d5bc03e02fd1cf562a731025f9ee8d2e01 100644 (file)
--- a/model.cc
+++ b/model.cc
@@ -972,7 +972,7 @@ bool ModelChecker::process_mutex(ModelAction *curr)
                //unlock the lock
                state->locked = NULL;
                //wake up the other threads
-               action_list_t *waiters = get_safe_ptr_action(lock_waiters_map, curr->get_location());
+               action_list_t *waiters = get_safe_ptr_action(lock_waiters_map, mutex);
                //activate all the waiting threads
                for (action_list_t::iterator rit = waiters->begin(); rit != waiters->end(); rit++) {
                        scheduler->wake(get_thread(*rit));
@@ -984,7 +984,7 @@ bool ModelChecker::process_mutex(ModelAction *curr)
                //unlock the lock
                state->locked = NULL;
                //wake up the other threads
-               action_list_t *waiters = get_safe_ptr_action(lock_waiters_map, (void *) curr->get_value());
+               action_list_t *waiters = get_safe_ptr_action(lock_waiters_map, mutex);
                //activate all the waiting threads
                for (action_list_t::iterator rit = waiters->begin(); rit != waiters->end(); rit++) {
                        scheduler->wake(get_thread(*rit));