MCPcopy Create free account
hub / github.com/crownengine/crown / stop

Method stop

src/core/thread/thread.cpp:111–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109}
110
111void Thread::stop()
112{
113 CE_ASSERT(_priv->_is_running, "Thread is not running");
114
115#if CROWN_PLATFORM_WINDOWS
116 WaitForSingleObject(_priv->handle, INFINITE);
117 GetExitCodeThread(_priv->handle, (DWORD *)&_priv->_exit_code);
118 CloseHandle(_priv->handle);
119 _priv->handle = INVALID_HANDLE_VALUE;
120#else
121 void *retval;
122 int err = pthread_join(_priv->handle, &retval);
123 CE_ASSERT(err == 0, "pthread_join: errno = %d", err);
124 CE_UNUSED(err);
125 _priv->_exit_code = (s32)(uintptr_t)retval;
126 _priv->handle = 0;
127#endif
128
129 _priv->_is_running = false;
130}
131
132bool Thread::is_running()
133{

Callers 9

test_threadFunction · 0.45
test_file_monitorFunction · 0.45
~ResourceLoaderMethod · 0.45
~DataCompilerMethod · 0.45
runMethod · 0.45
runMethod · 0.45
runMethod · 0.45
shutdownMethod · 0.45
~SaveGameMethod · 0.45

Calls

no outgoing calls

Tested by 2

test_threadFunction · 0.36
test_file_monitorFunction · 0.36