model: use get_mutex() and get_thread_operand() helpers
[c11tester.git] / model.cc
index 811d81a627b00357d8dc598ad16dcae4bc6911e9..4d62361197dd5c416a15ab6754186e60d679857e 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));