]> granicus.if.org Git - python/commit
faulthandler: one more time, fix usage of locks in the watchdog thread
authorVictor Stinner <victor.stinner@haypocalc.com>
Fri, 8 Apr 2011 10:57:06 +0000 (12:57 +0200)
committerVictor Stinner <victor.stinner@haypocalc.com>
Fri, 8 Apr 2011 10:57:06 +0000 (12:57 +0200)
commitde10f4054b6bd6dd286559d7bbaaff7364282fc7
tree9540bf576e1ce6f8be8e400c9c5e6f108f494544
parentcfa7123ef108452dd402e3cdcec772be28872e2f
faulthandler: one more time, fix usage of locks in the watchdog thread

 * Write a new test to ensure that dump_tracebacks_later() still works if
   it was already called and then cancelled before
 * Don't use a variable to check the status of the thread, only rely on locks
 * The thread only releases cancel_event if it was able to acquire it (if
   the timer was interrupted)
 * The main thread always hold this lock. It is only released when
   faulthandler_thread() is interrupted until this thread exits, or at Python
   exit.
Lib/test/test_faulthandler.py
Modules/faulthandler.c