real_pthread_exit(NULL);
}
-int pthread_mutex_init(pthread_mutex_t *p_mutex, const pthread_mutexattr_t *) {
+int pthread_mutex_init(pthread_mutex_t *p_mutex, const pthread_mutexattr_t * attr) {
if (!model) {
snapshot_system_init(10000, 1024, 1024, 40000);
model = new ModelChecker();
model->startChecker();
}
- cdsc::snapmutex *m = new cdsc::snapmutex();
+
+ int mutex_type = PTHREAD_MUTEX_DEFAULT;
+ if (attr != NULL)
+ pthread_mutexattr_gettype(attr, &mutex_type);
+
+ cdsc::snapmutex *m = new cdsc::snapmutex(mutex_type);
ModelExecution *execution = model->get_execution();
execution->getMutexMap()->put(p_mutex, m);