73 bool IsThisThreadIn()
const;
79 bool IsThreadIn(std::thread* threadPtr)
const;
85 bool IsThreadIn(
const std::thread::id&
id)
const;
91 template <
typename F> std::thread*
CreateThread(F&& threadfunction)
93 std::lock_guard<std::mutex> lock{m_mutex};
94 std::unique_ptr<std::thread> newThread{
new std::thread(std::forward<F>(threadfunction))};
95 m_threadGroup.push_back(newThread.get());
96 return newThread.release();
105 void AddThread(std::thread* threadPtr);
110 void RemoveThread(std::thread* threadPtr);
120 std::thread* RemoveThread(
const std::thread::id&
id);
148 bool IsThisThreadInNoMutex()
const;
154 bool IsThreadInNoMutex(
const std::thread::id&
id)
const;
159 static void DeleteThread(std::thread* threadPtr);
165 #endif // THREADGROUP std::thread * CreateThread(F &&threadfunction)
Create and add thread to group.
Definition: ThreadGroup.h:91
std::mutex m_mutex
Access mutex for private data.
Definition: ThreadGroup.h:137
The core_lib namespace.
Definition: AsioDefines.h:59
Thread group class.
Definition: ThreadGroup.h:54
File containing declaration of DLL import/export control defines.
thread_list m_threadGroup
List containing threads.
Definition: ThreadGroup.h:143
thread_list::iterator thread_list_iter
Typedef for thread list iterator type.
Definition: ThreadGroup.h:141
std::list< std::thread * > thread_list
Typedef for thread list type.
Definition: ThreadGroup.h:139