From 39997cfebf5a9209d74acc0642f952368eb01a21 Mon Sep 17 00:00:00 2001 From: zeromus Date: Wed, 16 Jan 2013 09:24:53 +0000 Subject: [PATCH] fix bug from r4479 in windows with softrasterizer task freezing --- desmume/src/utils/task.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/desmume/src/utils/task.cpp b/desmume/src/utils/task.cpp index 1999e7e17..31bc7509a 100644 --- a/desmume/src/utils/task.cpp +++ b/desmume/src/utils/task.cpp @@ -148,7 +148,11 @@ void* Task::Impl::finish() if(spinlock) while(!bWorkDone) Sleep(0); - else WaitForSingleObject(workDone,INFINITE); + else + { + if(!bWorkDone) + WaitForSingleObject(workDone,INFINITE); + } return param; }