Created
October 22, 2013 22:16
-
-
Save cjhanks/7109153 to your computer and use it in GitHub Desktop.
sigusr1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from signal import signal, SIGUSR1 | |
| from traceback import format_stack | |
| from sys import stderr | |
| def dump_frame(sig, frame): | |
| if sig is SIGUSR1: | |
| stderr.write(''.join(format_stack(frame))) | |
| def t1(): | |
| from time import sleep | |
| while True: | |
| sleep(3) | |
| def t0(): | |
| return t1() | |
| signal(SIGUSR1, dump_frame) | |
| t0() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment