MCPcopy Create free account
hub / github.com/RichieSams/FiberTaskingLib / CreateThread

Function CreateThread

source/thread_abstraction.cpp:71–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69# pragma warning(pop)
70
71bool 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
79bool 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));

Callers 1

InitMethod · 0.85

Calls 1

SetThreadNameFunction · 0.85

Tested by

no test coverage detected