From: Jean-Philippe Bruyère Date: Mon, 28 Aug 2017 03:00:12 +0000 (+0200) Subject: prevent canceling thread multiple times causing a deadlock X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=94708b811f5f256300453588027fe54550236b6d;p=jp%2Fcrow.git prevent canceling thread multiple times causing a deadlock --- diff --git a/src/CrowThread.cs b/src/CrowThread.cs index 7e00d1b3..823fe1a6 100644 --- a/src/CrowThread.cs +++ b/src/CrowThread.cs @@ -53,11 +53,9 @@ namespace Crow } public void Start() { thread.Start();} public void Cancel(){ - if (thread.IsAlive){ + if (thread.IsAlive & !cancelRequested){ cancelRequested = true; - //cancelLoading = true; thread.Join (); - //cancelLoading = false; } lock (Host.currentInterface.CrowThreads) Host.currentInterface.CrowThreads.Remove (this);