Files
unity/crnlib/crn_semaphore.h
T
richgel99@gmail.com 9f98ea7e22
2011-12-27 21:18:07 +00:00

26 lines
610 B
C++

// File: crn_semaphore.h
// See Copyright Notice and license at the end of inc/crnlib.h
#pragma once
namespace crnlib
{
class semaphore
{
CRNLIB_NO_COPY_OR_ASSIGNMENT_OP(semaphore);
public:
semaphore(int32 initialCount = 0, int32 maximumCount = 1, const char* pName = NULL);
~semaphore();
inline void *get_handle(void) const { return m_handle; }
void release(int32 releaseCount = 1, int32 *pPreviousCount = NULL);
bool wait(uint32 milliseconds = UINT32_MAX);
private:
void *m_handle;
};
} // namespace crnlib