Created
February 1, 2016 22:34
-
-
Save nickmbailey/979614eae0f9607616e9 to your computer and use it in GitHub Desktop.
This file contains 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
import threading | |
from _io import _IOBase | |
def create_gc(): | |
io = _IOBase() | |
print io | |
del io | |
t = threading.Timer(0.001, create_gc) | |
t.start() | |
def call_close(): | |
io = _IOBase() | |
print io | |
io.close() | |
t = threading.Timer(0.001, call_close) | |
t.start() | |
for i in range(30): | |
t1 = threading.Timer(1.0, create_gc) | |
t1.start() | |
t2 = threading.Timer(1.0, call_close) | |
t2.start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Demonstrates a deadlock bug in jython. First apply this patch:
Then run the above script:
You will see the script stop outputting and enter a deadlocked state before very long.