X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=pthread.cc;h=95fa57a24515aaa69587eb08ea87d1a6a6849d09;hb=52eaf0382899b8dd65486fc8c0933d7cae6c98bf;hp=276e37587e43de82e2ff8f84ca30aca3dc4cb7d9;hpb=75258105eece346fe9523767d12349775a3a073d;p=c11tester.git diff --git a/pthread.cc b/pthread.cc index 276e3758..95fa57a2 100644 --- a/pthread.cc +++ b/pthread.cc @@ -202,3 +202,15 @@ int pthread_cond_signal(pthread_cond_t *p_cond) { v->notify_one(); return 0; } + +int pthread_cond_broadcast(pthread_cond_t *p_cond) { + // notify all blocked threads + ModelExecution *execution = model->get_execution(); + if ( !execution->getCondMap()->contains(p_cond) ) + pthread_cond_init(p_cond, NULL); + + cdsc::snapcondition_variable *v = execution->getCondMap()->get(p_cond); + + v->notify_all(); + return 0; +}