def monitor():
 global exitedThreads
 ui = getglobalui()
 while True:
  try:
   thread = exitedThreads.get(True, 60)
   if (thread.exit_exception is not None):
    if isinstance(thread.exit_exception, SystemExit):
     raise SystemExit
    ui.threadException(thread)
    raise AssertionError(("thread has 'exit_exception' set to '%s' [%s] but this value is unexpected and the ui did not stop the program." % (repr(thread.exit_exception), type(thread.exit_exception))))
   elif (thread.exit_message == STOP_MONITOR):
    break
   else:
    ui.threadExited(thread)
  except Empty:
   pass

def monitor ( ) : global exitedThreads ui = getglobalui ( ) while True : try : thread = exitedThreads . get ( True , 60 ) if ( thread . exit_exception is not None ) : if isinstance ( thread . exit_exception , SystemExit ) : raise SystemExit ui . threadException ( thread ) raise AssertionError ( ( "thread has 'exit_exception' set to '%s' [%s] but this value is unexpected and the ui did not stop the program." % ( repr ( thread . exit_exception ) , type ( thread . exit_exception ) ) ) ) elif ( thread . exit_message == STOP_MONITOR ) : break else : ui . threadExited ( thread ) except Empty : pass
monitor() [0] start an interactive remote monitor .