Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
some MC tests still believe that platform.xml exist
[simgrid.git] / src / s4u / s4u_conditionVariable.cpp
1 #include "simgrid/s4u/conditionVariable.hpp"
2 #include "simgrid/simix.h"
3
4 using namespace simgrid;
5
6 s4u::ConditionVariable::ConditionVariable()  : cond_(simcall_cond_init()){
7     
8 }
9
10 s4u::ConditionVariable::~ConditionVariable() {
11   SIMIX_cond_unref(cond_);
12 }
13
14 /**
15  * Wait functions
16  */
17 void s4u::ConditionVariable::wait(s4u::Mutex *mutex) {
18   simcall_cond_wait(cond_, mutex->mutex_);
19 }
20   
21 void s4u::ConditionVariable::wait_for(s4u::Mutex *mutex, double timeout) {
22   simcall_cond_wait_timeout(cond_, mutex->mutex_, timeout);
23 }
24   
25 /**
26  * Notify functions
27  */
28 void s4u::ConditionVariable::notify() { 
29    simcall_cond_signal(cond_);
30 }
31  
32 void s4u::ConditionVariable::notify_all() {
33   simcall_cond_broadcast(cond_);
34 }
35
36