]> O.S.I.I.S - jp/crow.git/commitdiff
prevent canceling thread multiple times causing a deadlock
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Mon, 28 Aug 2017 03:00:12 +0000 (05:00 +0200)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Mon, 28 Aug 2017 03:00:12 +0000 (05:00 +0200)
src/CrowThread.cs

index 7e00d1b395fc7ea683bd83a5e7cfae6681d40561..823fe1a63b0df92776267b413410c42900294144 100644 (file)
@@ -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);