projects
/
c11tester.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Do not report deadlock on relocking a recursive mutex; lock count not implemented yet
[c11tester.git]
/
pthread.cc
diff --git
a/pthread.cc
b/pthread.cc
index 706f1b75602ef6ae33e2876be5064dcd10ab18a3..50214c34b31d6d578e4d732c11865eab9b3a3a89 100644
(file)
--- a/
pthread.cc
+++ b/
pthread.cc
@@
-66,13
+66,18
@@
void pthread_exit(void *value_ptr) {
real_pthread_exit(NULL);
}
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();
}
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);
ModelExecution *execution = model->get_execution();
execution->getMutexMap()->put(p_mutex, m);