AWS SDK for C++

AWS SDK for C++ Version 1.11.440

Loading...
Searching...
No Matches
DefaultExecutor.h
1
6#pragma once
7
8#include <aws/core/utils/threading/Executor.h>
9
10#include <aws/core/utils/memory/stl/AWSMap.h>
11
12#include <atomic>
13#include <functional>
14#include <mutex>
15#include <thread>
16
17namespace Aws
18{
19 namespace Utils
20 {
21 namespace Threading
22 {
26 class AWS_CORE_API DefaultExecutor : public Executor
27 {
28 public:
29 DefaultExecutor() : m_state(State::Free) {}
31
32 void WaitUntilStopped() override;
33 protected:
34 enum class State
35 {
36 Free, Locked, Shutdown
37 };
38 bool SubmitToThread(std::function<void()>&&) override;
39 void Detach(std::thread::id id);
40 std::atomic<State> m_state;
42 };
43 } // namespace Threading
44 } // namespace Utils
45} // namespace Aws
Aws::UnorderedMap< std::thread::id, std::thread > m_threads
bool SubmitToThread(std::function< void()> &&) override
void Detach(std::thread::id id)
AWS_CORE_API void Free(void *memoryPtr)
std::unordered_map< K, V, std::hash< K >, std::equal_to< K >, Aws::Allocator< std::pair< const K, V > > > UnorderedMap
Definition AWSMap.h:21