| 69 | # pragma warning(pop) |
| 70 | |
| 71 | bool CreateThread(size_t stackSize, ThreadStartRoutine startRoutine, void *arg, const char *name, ThreadType *returnThread) { |
| 72 | returnThread->Handle = reinterpret_cast<HANDLE>(_beginthreadex(nullptr, (unsigned)stackSize, startRoutine, arg, 0u, nullptr)); |
| 73 | SetThreadName(returnThread->Handle, name); |
| 74 | returnThread->Id = ::GetThreadId(returnThread->Handle); |
| 75 | |
| 76 | return returnThread != nullptr; |
| 77 | } |
| 78 | |
| 79 | bool CreateThread(size_t stackSize, ThreadStartRoutine startRoutine, void *arg, const char *name, size_t coreAffinity, ThreadType *returnThread) { |
| 80 | returnThread->Handle = reinterpret_cast<HANDLE>(_beginthreadex(nullptr, (unsigned)stackSize, startRoutine, arg, CREATE_SUSPENDED, nullptr)); |