1// Blocker.h
2
3#ifndef BLOCKER_H
4#define BLOCKER_H
5
6#include <OS.h>
7
8class Blocker {
9public:
10								Blocker();
11								Blocker(sem_id semaphore);
12								Blocker(const Blocker& other);
13								~Blocker();
14
15			status_t			InitCheck() const;
16
17			status_t			PrepareForUse();
18
19			status_t			Block(int32* userData = NULL);
20			status_t			Unblock(int32 userData = 0);
21
22			Blocker&			operator=(const Blocker& other);
23			bool				operator==(const Blocker& other) const;
24			bool				operator!=(const Blocker& other) const;
25
26private:
27			void				_Unset();
28
29private:
30			struct Data;
31
32			Data*				fData;
33};
34
35#endif	// BLOCKER_H
36