MCPcopy Create free account
hub / github.com/GarageGames/Torque2D / ThreadRunHandler

Function ThreadRunHandler

engine/source/platformAndroid/AndroidThread.cpp:46–65  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Function: ThreadRunHandler Summary: Calls Thread::run() with the thread's specified run argument. Neccesary because Thread::run() is provided as a non-threaded way to execute the thread's run function. So we have to keep track of the thread's lock here.

Source from the content-addressed store, hash-verified

44// way to execute the thread's run function. So we have to keep
45// track of the thread's lock here.
46static void *ThreadRunHandler(void * arg)
47{
48 PlatformThreadData *mData = reinterpret_cast<PlatformThreadData*>(arg);
49 Thread *thread = mData->mThread;
50
51 mData->mThreadID = ThreadManager::getCurrentThreadId();
52 ThreadManager::addThread(thread);
53 thread->run(mData->mRunArg);
54
55 mData->mGateway.release();
56 // we could delete the Thread here, if it wants to be auto-deleted...
57 if(thread->autoDelete)
58 {
59 ThreadManager::removeThread(thread);
60 delete thread;
61 }
62 // return value for pthread lib's benefit
63 return NULL;
64 // the end of this function is where the created pthread will die.
65}
66
67//-----------------------------------------------------------------------------
68Thread::Thread(ThreadRunFunction func, void* arg, bool start_thread, bool autodelete)

Callers

nothing calls this directly

Calls 2

runMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected