Ejemplo n.º 1
0
def cleanup(shutdownfn, exitstatus):
    # Turn off logging, so that window closing, etc. won't be logged.
    mainmenu.OOF.haltLog()

    if parallel_enable.enabled():
        try:
            from ooflib.SWIG.common import mpitools
            if mpitools.Rank() == 0:
                # tell back-end to start quit process
                mainmenu.OOF.LoadData.IPC.Quit()
        except ImportError:
            pass

    # Wait on a subthread for threads to finish, then call shutdownfn
    # on the main thread.  When called from the GUI callback for the
    # Quit command, shutdownfn is common.IO.GUI.shutdown.
    subthread.execute_immortal(waitForThreads, (shutdownfn, exitstatus))
Ejemplo n.º 2
0
def cleanup(shutdownfn, exitstatus):
    # Turn off logging, so that window closing, etc. won't be logged.
    mainmenu.OOF.haltLog()

    if parallel_enable.enabled():
        try:
            from ooflib.SWIG.common import mpitools
            if mpitools.Rank() == 0:
                # tell back-end to start quit process
                mainmenu.OOF.LoadData.IPC.Quit()
        except ImportError:
            pass
    
    # Wait on a subthread for threads to finish, then call shutdownfn
    # on the main thread.  When called from the GUI callback for the
    # Quit command, shutdownfn is common.IO.GUI.shutdown.
    subthread.execute_immortal(waitForThreads, (shutdownfn, exitstatus))
Ejemplo n.º 3
0
 def start(self):
     assert self.eventThread is None
     # This thread is shut down when cancel method is called which
     # happens when the toolbox is closed or switched to a
     # different mode.  It's started with execute_immortal instead
     # of just execute to avoid a race condition at shutdown time,
     # in which the window can be closing at the same time as the
     # miniThreadManager is shutting down threads.  Threads started
     # with execute_immortal aren't shut down by the
     # miniThreadManager.
     self.eventThread = subthread.execute_immortal(
         self.processEvents_subthread)