From 80f65bca8ca1cd86f47fe5e57ec84335b0fdb06c Mon Sep 17 00:00:00 2001 From: root Date: Mon, 22 Jul 2019 20:10:16 -0700 Subject: [PATCH] Add model checker check before trylock --- pthread.cc | 6 ++++++ 1 file changed, 6 insertions(+) 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(); -- 2.34.1