mirror of
https://github.com/ManchildProductions/UXP-Fixed.git
synced 2026-05-27 22:18:26 +00:00
19 lines
325 B
Python
19 lines
325 B
Python
import threading
|
|
import time
|
|
import sys
|
|
import signal
|
|
|
|
if 'deadlock' in sys.argv:
|
|
lock = threading.Lock()
|
|
|
|
def trap(sig, frame):
|
|
lock.acquire()
|
|
|
|
# get the lock once
|
|
lock.acquire()
|
|
# and take it again on SIGTERM signal: deadlock.
|
|
signal.signal(signal.SIGTERM, trap)
|
|
|
|
while 1:
|
|
time.sleep(1)
|