Files
UXP-Fixed/testing/mozbase/mozprocess/tests/infinite_loop.py
T
2018-02-02 04:16:08 -05:00

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)