add pthread_cond_destory
[c11tester.git] / pthread.cc
index d23c4900f6382b62ed39c70c434e852c1e4f22ab..bad6beae1d60c761aac5f3c887700028f838c958 100644 (file)
@@ -220,3 +220,13 @@ 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);
+       }
+}