acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
semaphore.h
1#pragma once
2
3
4
5#include "acme/operating_system/security_attributes.h"
6
7
8class CLASS_DECL_ACME semaphore :
9 virtual public particle
10{
11public:
12
13
14 string m_strName;
15
16#ifdef WINDOWS
17
18 ::hsynchronization m_handleSemaphore;
19
20#elif defined(__ANDROID__)
21
22 ::i32 m_lMaxCount;
23 sem_t * m_psem;
24
25#elif defined(LINUX) || defined(__APPLE__) || defined(__BSD__)
26
27 ::i32 m_lMaxCount;
28 ::i32 m_hsync;
29
30#endif
31
32 semaphore(::i32 lInitialCount = 1, ::i32 lMaxCount = 1, const_char_pointer pstrName=nullptr, security_attributes * psecurityattributes = nullptr);
33 ~semaphore() override;
34
35
36//#if defined(__APPLE__) || defined(LINUX) || defined(__ANDROID__) || defined(SOLARIS) || defined(FREEBSD) || defined(OPENBSD)
37// using matter::lock;
38 bool _wait(const class time & timeWait) override;
39//#endif
40
41 void unlock() override;
42 void unlock(::i32 lCount, ::i32 * prevCount = nullptr) override;
43
44
45};
46
47
48
Definition security_attributes.h:7
Definition aaa_time.h:13