|
|
@ -49,6 +49,16 @@ int GetCurrentThreadName(char *str, const char *last);
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void SetSelfAsMainThread();
|
|
|
|
void SetSelfAsMainThread();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Perform per-thread setup
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
void PerThreadSetup();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Setup thread functionality required for later calls to PerThreadSetup
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
void PerThreadSetupInit();
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @return true if the current thread definitely the "main" thread. If in doubt returns false.
|
|
|
|
* @return true if the current thread definitely the "main" thread. If in doubt returns false.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -77,6 +87,7 @@ inline bool StartNewThread(std::thread *thr, const char *name, TFn&& _Fx, TArgs&
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
std::thread t([] (const char *name, TFn&& F, TArgs&&... A) {
|
|
|
|
std::thread t([] (const char *name, TFn&& F, TArgs&&... A) {
|
|
|
|
SetCurrentThreadName(name);
|
|
|
|
SetCurrentThreadName(name);
|
|
|
|
|
|
|
|
PerThreadSetup();
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
/* Call user function with the given arguments. */
|
|
|
|
/* Call user function with the given arguments. */
|
|
|
|
F(A...);
|
|
|
|
F(A...);
|
|
|
|