SemaphoreWrapper/include/SemaphoreWrapper.h

18 lines
306 B
C++

#pragma once
class ProcessSemaphore
{
public:
/// action: 0 MustGet 1 MustCreateNew
ProcessSemaphore(int key,int action=0,int default_value=1);
bool isReady() const;
int p(); /// wait
int v(); /// notify
int wait(); /// p
int notify(); /// v
~ProcessSemaphore();
private:
class impl;
impl* _p;
};