Skip to content

Commit 2e08706

Browse files
committed
experiment with joining websocket thread on exit..
1 parent 78980fb commit 2e08706

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

vpython/no_notebook.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ def run(*args, **kwargs):
5050

5151
# Check for Ctrl+C. SIGINT will also be sent by our code if WServer is closed.
5252
def signal_handler(signal, frame):
53+
print("in signal handler, calling stop server")
5354
stop_server()
5455

5556
signal.signal(signal.SIGINT, signal_handler)
@@ -362,8 +363,12 @@ def stop_server():
362363
# check to see if the event loop is still going, if so join it.
363364
#
364365
if __t.is_alive():
366+
print("__t is alive still")
365367
if threading.get_ident() != __t.ident:
368+
print("but it's not my thread, so I'll join...")
366369
__t.join()
370+
else:
371+
print("__t is alive, but that's my thread! Yikes.")
367372

368373
# If the main thread has already stopped, the python interpreter
369374
# is likely just running .join on the two remaining threads (in

0 commit comments

Comments
 (0)