X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=pthread.cc;h=e64cd134b91f4b4aebf0723adc78e283154b7c50;hb=25d73096cfc14c655f94b01bb235cc5efd1d5696;hp=e95fb37a3c9b079599b19ca90dd9f00d74fd66b3;hpb=251ac4b4bf3a9f2d3cfacc1e6618200ca1c431ac;p=c11tester.git diff --git a/pthread.cc b/pthread.cc index e95fb37a..e64cd134 100644 --- a/pthread.cc +++ b/pthread.cc @@ -119,7 +119,7 @@ int pthread_mutex_trylock(pthread_mutex_t *p_mutex) { ModelExecution *execution = model->get_execution(); cdsc::snapmutex *m = execution->getMutexMap()->get(p_mutex); - return m->try_lock(); + return m->try_lock() ? 0 : EBUSY; } int pthread_mutex_unlock(pthread_mutex_t *p_mutex) { ModelExecution *execution = model->get_execution();