mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 00:06:44 -04:00
pipeline: Don't use Sleep(1) to yield on Windows
Use Sleep(0) instead. Sleep(0) is not guaranteed to yield, which is a problem, but Sleep(1) can easily take up to 16 ms, which is really unacceptable except in very low-priority thread. But really, you shouldn't be relying on force_yield() for anything except with the SIMPLE_THREADS model. There is also SwitchToThread(), but in fact it is even weaker than Sleep(0).
This commit is contained in:
parent
cb8563acac
commit
c2d088f232
@ -76,7 +76,7 @@ sleep(double seconds) {
|
|||||||
*/
|
*/
|
||||||
INLINE void ThreadWin32Impl::
|
INLINE void ThreadWin32Impl::
|
||||||
yield() {
|
yield() {
|
||||||
Sleep(1);
|
Sleep(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user