2011-04-04 09:58:52 +00:00
|
|
|
#ifndef __CSEMAPHORE_H__
|
|
|
|
#define __CSEMAPHORE_H__
|
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
|
2011-04-04 16:25:20 +00:00
|
|
|
extern "C" {
|
|
|
|
#include "Tier0/atomic_operations.h"
|
|
|
|
};
|
|
|
|
|
2011-04-04 09:58:52 +00:00
|
|
|
namespace cb {
|
|
|
|
class CSemaphore {
|
|
|
|
private:
|
2011-04-04 16:25:20 +00:00
|
|
|
T_ATOMIC m_Available;
|
2011-04-04 09:58:52 +00:00
|
|
|
public:
|
|
|
|
CSemaphore(u32 Available = 1);
|
|
|
|
void Acquire(void);
|
|
|
|
void Release(void);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|