Module: wine Branch: master Commit: fcccca153a1db3d1151c62521b0670ecb4194619 URL: https://gitlab.winehq.org/wine/wine/-/commit/fcccca153a1db3d1151c62521b0670e...
Author: Matteo Bruni mbruni@codeweavers.com Date: Thu Nov 15 22:39:45 2018 +0100
wined3d: Make the CS thread yield CPU when it can't block waiting.
It can't block because there are pending queries.
---
dlls/wined3d/cs.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index 2cd53cd7a5b..04e37f5e712 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -3422,8 +3422,13 @@ static DWORD WINAPI wined3d_cs_run(void *ctx) if (wined3d_cs_queue_is_empty(cs, queue)) { YieldProcessor(); - if (++spin_count >= WINED3D_CS_SPIN_COUNT && list_empty(&cs->query_poll_list)) - wined3d_cs_wait_event(cs); + if (++spin_count >= WINED3D_CS_SPIN_COUNT) + { + if (list_empty(&cs->query_poll_list)) + wined3d_cs_wait_event(cs); + else + Sleep(0); + } continue; } }