AWS SDK for C++

AWS SDK for C++ Version 1.11.440

Loading...
Searching...
No Matches
Semaphore.h
1
6#pragma once
7
8#include <aws/core/Core_EXPORTS.h>
9#include <mutex>
10#include <condition_variable>
11
12namespace Aws
13{
14 namespace Utils
15 {
16 namespace Threading
17 {
18 class AWS_CORE_API Semaphore {
19 public:
24 Semaphore(size_t initialCount, size_t maxCount);
28 void WaitOne();
33 bool WaitOneFor(size_t timeoutMs);
37 void Release();
41 void ReleaseAll();
42 private:
43 size_t m_count;
44 const size_t m_maxCount;
45 std::mutex m_mutex;
46 std::condition_variable m_syncPoint;
47 };
48 }
49 }
50}
bool WaitOneFor(size_t timeoutMs)
Semaphore(size_t initialCount, size_t maxCount)