Browse Source

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

Otherwise background threads keep the program alive, which is not consistent with other targets.
Zeta 4 months ago
parent
commit
32aa475f65
1 changed files with 1 additions and 1 deletions
  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();