Revision 463434d4 include/cbarriermessage.h

View differences:

include/cbarriermessage.h
24 24
#include "cmessage.h"
25 25
#include "casyncmodule.h"
26 26

  
27
#ifdef ATOMIC_OPS_DEBUG
28
    #include "catomicopsdebug.h"
29
#else
30
    #include <atomic_ops.h>
31
#endif
27 32

  
28 33
/**
29 34
 * This class implements a special barrier message type derived from cMessage.
......
45 50
  private:
46 51
    // the semaphore used to block the calling thread on calling wait()
47 52
    sem_t sem;
48
    bool valid; //set to false if barrier has already been signaled
53
    AO_t valid; //set to false if barrier has already been signaled
49 54

  
50 55
  public:
51 56
    /** @name Constructor and destructor and stuff */
......
129 134
    inline void signal()
130 135
    {
131 136
        sem_post(&sem);
132
        valid = false;
137
        AO_store(&valid, 0);
133 138
    }
134 139

  
135 140
    inline bool isValid() {
136
        return valid;
141
        return AO_load_read(&valid) !=0;
137 142
    }
138 143
    //@}
139 144
};

Also available in: Unified diff