From fcccca153a1db3d1151c62521b0670ecb4194619 Mon Sep 17 00:00:00 2001 From: Matteo Bruni Date: Thu, 15 Nov 2018 22:39:45 +0100 Subject: [PATCH] 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; } }