Add model checker check before trylock
authorroot <root@dw-6.eecs.uci.edu>
Tue, 23 Jul 2019 03:10:16 +0000 (20:10 -0700)
committerroot <root@dw-6.eecs.uci.edu>
Tue, 23 Jul 2019 03:10:16 +0000 (20:10 -0700)
pthread.cc

index 95fa57a24515aaa69587eb08ea87d1a6a6849d09..d23c4900f6382b62ed39c70c434e852c1e4f22ab 100644 (file)
@@ -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();