mirror of
https://github.com/wiiu-env/wut.git
synced 2024-12-04 20:14:18 +01:00
wutstdc++: Use OSSetThreadRunQuantum in gthread implementation.
To emulate pre-emptive scheduling which is what would be expected from gthread.
This commit is contained in:
parent
a35269d207
commit
d39e7cad4a
@ -43,6 +43,11 @@ __wut_thread_create(OSThread **outThread,
|
||||
*outThread = thread;
|
||||
OSSetThreadDeallocator(thread, &__wut_thread_deallocator);
|
||||
OSSetThreadCleanupCallback(thread, &__wut_thread_cleanup);
|
||||
|
||||
// Set a thread run quantum to 1 millisecond, to force the threads to
|
||||
// behave more like pre-emptive scheduling rather than co-operative.
|
||||
OSSetThreadRunQuantum(thread, 1000);
|
||||
|
||||
OSResumeThread(thread);
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user