projects
/
c11tester.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6869097
)
Add model checker check before trylock
author
root
<root@dw-6.eecs.uci.edu>
Tue, 23 Jul 2019 03:10:16 +0000
(20:10 -0700)
committer
root
<root@dw-6.eecs.uci.edu>
Tue, 23 Jul 2019 03:10:16 +0000
(20:10 -0700)
pthread.cc
patch
|
blob
|
history
diff --git
a/pthread.cc
b/pthread.cc
index 95fa57a24515aaa69587eb08ea87d1a6a6849d09..d23c4900f6382b62ed39c70c434e852c1e4f22ab 100644
(file)
--- a/
pthread.cc
+++ b/
pthread.cc
@@
-103,6
+103,12
@@
int pthread_mutex_lock(pthread_mutex_t *p_mutex) {
}
int pthread_mutex_trylock(pthread_mutex_t *p_mutex) {
+ if (!model) {
+ snapshot_system_init(10000, 1024, 1024, 40000);
+ model = new ModelChecker();
+ model->startChecker();
+ }
+
ModelExecution *execution = model->get_execution();
cdsc::snapmutex *m = execution->getMutexMap()->get(p_mutex);
return m->try_lock();