model: use get_mutex() and get_thread_operand() helpers
authorBrian Norris <banorris@uci.edu>
Wed, 3 Apr 2013 00:52:12 +0000 (17:52 -0700)
committerBrian Norris <banorris@uci.edu>
Wed, 3 Apr 2013 00:52:12 +0000 (17:52 -0700)
model.cc

index 811d81a..4d62361 100644 (file)
--- a/model.cc
+++ b/model.cc
@@ -1457,12 +1457,12 @@ void ModelChecker::thread_blocking_check_promises(Thread *blocker, Thread *waiti
  */
 bool ModelChecker::check_action_enabled(ModelAction *curr) {
        if (curr->is_lock()) {
-               std::mutex *lock = (std::mutex *)curr->get_location();
+               std::mutex *lock = curr->get_mutex();
                struct std::mutex_state *state = lock->get_state();
                if (state->locked)
                        return false;
        } else if (curr->is_thread_join()) {
-               Thread *blocking = (Thread *)curr->get_location();
+               Thread *blocking = curr->get_thread_operand();
                if (!blocking->is_complete()) {
                        blocking->push_wait_list(curr);
                        thread_blocking_check_promises(blocking, get_thread(curr));