Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
platform
Concurrency
SemaphoreEegeo.h
1
// Copyright eeGeo Ltd (2012-2021), All Rights Reserved
2
3
#pragma once
4
5
#include <iostream>
6
#include "Types.h"
7
8
#if defined(EEGEO_IOS) || defined(EEGEO_OSX)
9
#include <dispatch/dispatch.h>
10
#elif defined(EEGEO_DROID) || defined(EEGEO_WIN) || defined(__EMSCRIPTEN_PTHREADS__)
11
#include <semaphore.h>
12
#endif
13
14
namespace
Eegeo
15
{
16
namespace
Concurrency
17
{
18
class
Semaphore
:
protected
Eegeo::NonCopyable
19
{
20
public
:
21
Semaphore
();
22
~
Semaphore
();
23
24
void
Wait();
25
bool
TryWait();
26
void
Signal();
27
private
:
28
#if defined(EEGEO_IOS) || defined(EEGEO_OSX)
29
dispatch_semaphore_t m_semaphore;
30
#elif defined(EEGEO_DROID) || defined(EEGEO_WIN) || defined(__EMSCRIPTEN_PTHREADS__)
31
sem_t m_semaphore;
32
#elif defined(EMSCRIPTEN)
33
u32 m_semaphore;
34
#endif
35
};
36
}
37
}
38
Generated on Sat Jun 10 2023 02:00:29 for eeGeo Platform SDK by
1.8.3.1