All pastes #1696008 Raw Edit

sec

public text v1 · immutable
#1696008 ·published 2009-12-01 08:56 UTC
rendered paste body
import threadingimport mimetypesimport timerace_flag = threading.Event()class Thread(threading.Thread):    def run(self):        race_flag.wait()        mimetypes.guess_type('sss')threads = []for i in range(2):    t = Thread()    t.start()    threads.append(t)time.sleep(0.5)print "run"race_flag.set()time.sleep(1)[t.join() for t in threads]print "ok"