| 126 | } |
| 127 | |
| 128 | void* PxThreadStart(void* arg) |
| 129 | { |
| 130 | _ThreadImpl* impl = getThread(reinterpret_cast<ThreadImpl*>(arg)); |
| 131 | impl->state = _PxThreadStarted; |
| 132 | |
| 133 | // run setTid in thread's context |
| 134 | setTid(*impl); |
| 135 | |
| 136 | // then run either the passed in function or execute from the derived class (Runnable). |
| 137 | if(impl->fn) |
| 138 | (*impl->fn)(impl->arg); |
| 139 | else if(impl->arg) |
| 140 | (reinterpret_cast<Runnable*>(impl->arg))->execute(); |
| 141 | return 0; |
| 142 | } |
| 143 | } |
| 144 | |
| 145 | uint32_t ThreadImpl::getSize() |