DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Mercurial (dcc6d7a0dc00)

VCS Links

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
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)