change some data structures
[c11tester.git] / pthread.cc
index d23c4900f6382b62ed39c70c434e852c1e4f22ab..c96777488ee8cae08c20dcf88ab98d4c20e5caf3 100644 (file)
@@ -189,7 +189,7 @@ int pthread_cond_timedwait(pthread_cond_t *p_cond,
                pthread_mutex_init(p_mutex, NULL);
 
        cdsc::snapcondition_variable *v = execution->getCondMap()->get(p_cond);
-       cdsc::snapmutex *m = execution->getMutexMap()->get(p_mutex);
+//     cdsc::snapmutex *m = execution->getMutexMap()->get(p_mutex);
 
        model->switch_to_master(new ModelAction(NOOP, std::memory_order_seq_cst, v));
 //     v->wait(*m);
@@ -220,3 +220,14 @@ int pthread_cond_broadcast(pthread_cond_t *p_cond) {
        v->notify_all();
        return 0;
 }
+
+int pthread_cond_destroy(pthread_cond_t *p_cond) {
+       ModelExecution *execution = model->get_execution();
+
+       if (execution->getCondMap()->contains(p_cond)) {
+               cdsc::snapcondition_variable *v = execution->getCondMap()->get(p_cond);
+               delete v;
+               execution->getCondMap()->remove(p_cond);
+       }
+       return 0;
+}