From dd5decee5ed5ebbc4f13556a6f42ff3ccdda3ab4 Mon Sep 17 00:00:00 2001 From: cxl Date: Mon, 6 Nov 2017 17:15:26 +0000 Subject: [PATCH] CoWork: CoWork::FinLock now ignored if not in worker git-svn-id: svn://ultimatepp.org/upp/trunk@11437 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/Core/CoWork.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/uppsrc/Core/CoWork.cpp b/uppsrc/Core/CoWork.cpp index a2e98a949..2a21ac89e 100644 --- a/uppsrc/Core/CoWork.cpp +++ b/uppsrc/Core/CoWork.cpp @@ -77,8 +77,10 @@ CoWork::Pool::~Pool() void CoWork::FinLock() { - Pool::finlock = true; - GetPool().lock.Enter(); + if(current) { + Pool::finlock = true; + GetPool().lock.Enter(); + } } void CoWork::Pool::DoJob(MJob& job) @@ -99,6 +101,7 @@ void CoWork::Pool::DoJob(MJob& job) LLOG("DoJob caught exception"); exc = std::current_exception(); } + CoWork::current = NULL; if(!finlock) lock.Enter(); if(!work)