projects
/
model-checker.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
action: add get_mutex()
[model-checker.git]
/
model.cc
diff --git
a/model.cc
b/model.cc
index 86289a0738a7965727fb4620a0021bbb8e2c90d0..7741760025162b786b48c903aaf86937bb4cb0f1 100644
(file)
--- a/
model.cc
+++ b/
model.cc
@@
-927,16
+927,11
@@
bool ModelChecker::process_read(ModelAction *curr)
*/
bool ModelChecker::process_mutex(ModelAction *curr)
{
*/
bool ModelChecker::process_mutex(ModelAction *curr)
{
- std::mutex *mutex =
NULL
;
+ std::mutex *mutex =
curr->get_mutex()
;
struct std::mutex_state *state = NULL;
struct std::mutex_state *state = NULL;
- if (curr->is_trylock() || curr->is_lock() || curr->is_unlock()) {
- mutex = (std::mutex *)curr->get_location();
+ if (mutex)
state = mutex->get_state();
state = mutex->get_state();
- } else if (curr->is_wait()) {
- mutex = (std::mutex *)curr->get_value();
- state = mutex->get_state();
- }
switch (curr->get_type()) {
case ATOMIC_TRYLOCK: {
switch (curr->get_type()) {
case ATOMIC_TRYLOCK: {