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