#include <thread.h>
Inheritance diagram for Thread:
Collaboration diagram for Thread:Public Member Functions | |
| Thread (const std::string &name="") | |
| virtual | ~Thread () |
| bool | start () |
| bool | stop () |
| bool | wait () |
| bool | isCurrentThread () |
| bool | isRunning () |
| bool | stopRequested () |
| std::thread::id | getThreadId () |
| bool | getReturnValue (void **ret) |
| bool | bindToProcessor (unsigned int proc_number) |
| bool | setPriority (int prio) |
Static Public Member Functions | |
| static Thread * | getCurrentThread () |
| static void | setName (const std::string &name) |
| static unsigned int | getNumberOfProcessors () |
Protected Member Functions | |
| virtual void * | run ()=0 |
Protected Attributes | |
| std::string | m_name |
Private Member Functions | |
| std::thread::native_handle_type | getThreadHandle () |
Static Private Member Functions | |
| static void | threadProc (Thread *thr) |
Private Attributes | |
| void * | m_retval = nullptr |
| bool | m_joinable = false |
| std::atomic< bool > | m_request_stop |
| std::atomic< bool > | m_running |
| std::mutex | m_mutex |
| std::mutex | m_start_finished_mutex |
| std::thread * | m_thread_obj = nullptr |
| Thread::Thread | ( | const std::string & | name = "" | ) |
|
virtual |
References getThreadHandle(), m_running, m_start_finished_mutex, wait(), and win32_native_handle.
Here is the call graph for this function:| bool Thread::bindToProcessor | ( | unsigned int | proc_number | ) |
|
static |
References current_thread.
Referenced by httpfetch_sync_interruptible().
Here is the caller graph for this function:
|
static |
Referenced by EmergeManager::EmergeManager(), MeshUpdateManager::MeshUpdateManager(), and AsyncEngine::initialize().
Here is the caller graph for this function:| bool Thread::getReturnValue | ( | void ** | ret | ) |
References m_retval, and m_running.
Referenced by TestThreading::testStartStopWait().
Here is the caller graph for this function:
|
inlineprivate |
References m_thread_obj.
Referenced by ~Thread(), bindToProcessor(), and setPriority().
Here is the caller graph for this function:
|
inline |
References m_thread_obj.
Referenced by isCurrentThread().
Here is the caller graph for this function:
|
inline |
References getThreadId().
Referenced by EmergeManager::getCurrentMapgen(), SimpleTestThread::run(), and TestThreading::testStartStopWait().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
References m_running.
Referenced by AsyncWorkerThread::~AsyncWorkerThread(), sound::ProxySoundManager::~ProxySoundManager(), EmergeManager::getCurrentMapgen(), LambdaThread::rethrow(), and TestThreading::testStartStopWait().
Here is the caller graph for this function:
|
protectedpure virtual |
Implemented in AsyncWorkerThread, AtomicTestThread, con::ConnectionReceiveThread, con::ConnectionSendThread, CurlFetchThread, EmergeThread, LambdaThread, ServerThread, SimpleTestThread, sound::OpenALSoundManager, TerminalChatConsole, TLSTestThread, and UpdateThread.
Referenced by threadProc().
Here is the caller graph for this function:
|
static |
| bool Thread::setPriority | ( | int | prio | ) |
References getThreadHandle(), THREAD_PRIORITY_HIGHEST, and win32_native_handle.
Here is the call graph for this function:| bool Thread::start | ( | ) |
References m_joinable, m_mutex, m_request_stop, m_running, m_start_finished_mutex, m_thread_obj, sleep_ms, and threadProc().
Referenced by Minimap::Minimap(), sound::ProxySoundManager::ProxySoundManager(), AsyncEngine::addWorkerThread(), run_dedicated_server(), Server::start(), TestThreading::testStartStopWait(), and TestThreading::testTLS().
Here is the call graph for this function:
Here is the caller graph for this function:| bool Thread::stop | ( | ) |
References m_request_stop.
Referenced by EmergeManager::~EmergeManager(), sound::ProxySoundManager::~ProxySoundManager(), EmergeThread::run(), run_dedicated_server(), Server::setAsyncFatalError(), Server::start(), Server::stop(), UpdateThread::stop(), TestThreading::testStartStopWait(), and TestThreading::testTLS().
Here is the caller graph for this function:
|
inline |
References m_request_stop.
Referenced by AsyncWorkerThread::run(), con::ConnectionReceiveThread::run(), con::ConnectionSendThread::run(), CurlFetchThread::run(), EmergeThread::run(), ServerThread::run(), SimpleTestThread::run(), TLSTestThread::run(), UpdateThread::run(), and con::ConnectionSendThread::sendPackets().
Here is the caller graph for this function:
|
staticprivate |
References current_thread, Logger::deregisterThread(), g_logger, m_name, m_retval, m_running, m_start_finished_mutex, Logger::registerThread(), run(), and setName().
Referenced by start().
Here is the call graph for this function:
Here is the caller graph for this function:| bool Thread::wait | ( | ) |
References m_joinable, m_mutex, m_running, and m_thread_obj.
Referenced by EmergeManager::~EmergeManager(), Minimap::~Minimap(), sound::ProxySoundManager::~ProxySoundManager(), ~Thread(), run_dedicated_server(), Server::stop(), TestThreading::testStartStopWait(), and TestThreading::testTLS().
Here is the caller graph for this function:
|
protected |
Referenced by EmergeThread::EmergeThread(), EmergeThread::run(), and threadProc().
|
private |
Referenced by start(), stop(), and stopRequested().
|
private |
Referenced by getReturnValue(), and threadProc().
|
private |
Referenced by ~Thread(), getReturnValue(), isRunning(), start(), threadProc(), and wait().
|
private |
Referenced by ~Thread(), start(), and threadProc().
|
private |
Referenced by getThreadHandle(), getThreadId(), start(), and wait().