ensure OS signals hit main-thread as intended;

use sigmasks to block SIGINT, SIGTERM, SIGUSR1 from all other threads

also initiate shutdown by calling sighandler directly,
in case this misses anything and that is still unreliable
(discovered by `--exit=idx` being noop once in a blue moon)
This commit is contained in:
ed 2024-05-09 22:28:16 +00:00
parent 2c92dab165
commit 87c60a1ec9
10 changed files with 63 additions and 43 deletions

View file

@ -6,7 +6,6 @@ import platform
import sys
import tarfile
import tempfile
import threading
import time
import traceback
@ -80,9 +79,7 @@ def run():
msg(" rsrc dir:", rsrc)
msg()
t = threading.Thread(target=utime, args=(rsrc,), name="utime")
t.daemon = True
t.start()
sys.argv.append("--sfx-tpoke=" + rsrc)
cm(rsrc=rsrc)