From: root Date: Tue, 23 Jul 2019 03:10:16 +0000 (-0700) Subject: Add model checker check before trylock X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=80f65bca8ca1cd86f47fe5e57ec84335b0fdb06c;p=c11tester.git Add model checker check before trylock --- diff --git a/pthread.cc b/pthread.cc index 95fa57a2..d23c4900 100644 --- 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();