Commit 14861824 authored by Armin Rigo's avatar Armin Rigo

Add a crasher for the long-standing issue with closing a file

while another thread uses it.
parent 27a4498f
# f.close() is not thread-safe: calling it at the same time as another
# operation (or another close) on the same file, but done from another
# thread, causes crashes. The issue is more complicated than it seems,
# witness the discussions in:
#
# http://bugs.python.org/issue595601
# http://bugs.python.org/issue815646
import thread
while 1:
f = open("multithreaded_close.tmp", "w")
thread.start_new_thread(f.close, ())
f.close()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment