From f1dcf001ab7df73c2cd2e464c2d6120a965a5928 Mon Sep 17 00:00:00 2001 From: Kevin Shanahan Date: Fri, 8 Feb 2013 16:51:36 +1030 Subject: [PATCH] common: don't interrupt thread progress when no threads running Signed-off-by: Kevin Shanahan --- common/threads.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/threads.c b/common/threads.c index d2a2df3f..98edb161 100644 --- a/common/threads.c +++ b/common/threads.c @@ -9,7 +9,8 @@ static qboolean threads_active = false; static int dispatch; static int workcount; -static int oldpercent; +static int oldpercent = -1; + /* * ============= * GetThreadWork @@ -132,6 +133,7 @@ RunThreadsOn(int start, int workcnt, void *(func)(void *)) WaitForSingleObject(threadhandle[i], INFINITE); threads_active = false; + oldpercent = -1; DeleteCriticalSection(&crit); logprint("\n"); @@ -245,6 +247,7 @@ RunThreadsOn(int start, int workcnt, void *(func)(void *)) } threads_active = false; + oldpercent = -1; status = pthread_mutex_destroy(my_mutex); if (status)