24
25 #ifndef OS_LINUX_WAITBARRIER_LINUX_HPP
26 #define OS_LINUX_WAITBARRIER_LINUX_HPP
27
28 #include "memory/allocation.hpp"
29
30 class LinuxWaitBarrier : public CHeapObj<mtInternal> {
31 volatile int _futex_barrier;
32
33 // Prevent copying and assignment of LinuxWaitBarrier instances.
34 LinuxWaitBarrier(const LinuxWaitBarrier&);
35 LinuxWaitBarrier& operator=(const LinuxWaitBarrier&);
36
37 public:
38 LinuxWaitBarrier() : _futex_barrier(0) {};
39 ~LinuxWaitBarrier() {};
40
41 const char* description() { return "futex"; }
42
43 void arm(int barrier_tag);
44 void disarm();
45 void wake();
46 void wait(int barrier_tag);
47 };
48
49 #endif // OS_LINUX_WAITBARRIER_LINUX_HPP
|
24
25 #ifndef OS_LINUX_WAITBARRIER_LINUX_HPP
26 #define OS_LINUX_WAITBARRIER_LINUX_HPP
27
28 #include "memory/allocation.hpp"
29
30 class LinuxWaitBarrier : public CHeapObj<mtInternal> {
31 volatile int _futex_barrier;
32
33 // Prevent copying and assignment of LinuxWaitBarrier instances.
34 LinuxWaitBarrier(const LinuxWaitBarrier&);
35 LinuxWaitBarrier& operator=(const LinuxWaitBarrier&);
36
37 public:
38 LinuxWaitBarrier() : _futex_barrier(0) {};
39 ~LinuxWaitBarrier() {};
40
41 const char* description() { return "futex"; }
42
43 void arm(int barrier_tag);
44 void wake();
45 void wait(int barrier_tag);
46 };
47
48 #endif // OS_LINUX_WAITBARRIER_LINUX_HPP
|