Sfoglia il codice sorgente

[python] Mark threads as daemon threads. (#12096)

Otherwise background threads keep the program alive, which is not consistent with other targets.
Zeta 8 mesi fa
parent
commit
32aa475f65
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      std/python/_std/sys/thread/Thread.hx

+ 1 - 1
std/python/_std/sys/thread/Thread.hx

@@ -124,7 +124,7 @@ private class HxThread {
 			}
 			dropThread(nt);
 		}
-		nt = new NativeThread({target:wrappedCallB});
+		nt = new NativeThread({target:wrappedCallB, daemon: true});
 		t = new HxThread(nt);
 		if(withEventLoop)
 			t.events = new EventLoop();