##// END OF EJS Templates
Fix (hopefully) another threadign bug, reported by Jorgen.
fperez -
r283:6e9469cf
parent child
Show More
@@ -4,7 +4,7
4 4 All the matplotlib support code was co-developed with John Hunter,
5 5 matplotlib's author.
6 6
7 $Id: Shell.py 1297 2006-05-13 19:14:48Z fperez $"""
7 $Id: Shell.py 1313 2006-05-19 17:48:41Z fperez $"""
8 8
9 9 #*****************************************************************************
10 10 # Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
@@ -361,8 +361,11 class MTInteractiveShell(InteractiveShell):
361 361 code_to_run = self.code_queue.get_nowait()
362 362 except Queue.Empty:
363 363 break
364 if got_lock:
364 365 self.thread_ready.notify()
365 366 InteractiveShell.runcode(self,code_to_run)
367 else:
368 break
366 369
367 370 # We're done with thread-protected variables
368 371 if got_lock:
@@ -372,8 +375,9 class MTInteractiveShell(InteractiveShell):
372 375
373 376 def kill (self):
374 377 """Kill the thread, returning when it has been shut down."""
375 self.thread_ready.acquire(False)
378 got_lock = self.thread_ready.acquire(False)
376 379 self._kill = True
380 if got_lock:
377 381 self.thread_ready.release()
378 382
379 383 class MatplotlibShellBase:
General Comments 0
You need to be logged in to leave comments. Login now