Package Ganga :: Package Core :: Package GangaThread :: Module GangaThreadPool' :: Class GangaThreadPool
[hide private]
[frames] | no frames]

Class GangaThreadPool

source code

Nested Classes [hide private]
  SingletonHelper
Instance Methods [hide private]
 
__alive_critical_thread_ids(self)
Return a list of alive critical thread names.
source code
 
__alive_non_critical_thread_ids(self)
Return a list of alive non-critical thread names.
source code
 
__cnt_alive_threads__(self) source code
 
__do_shutdown__(self) source code
 
__init__(self) source code
 
addServiceThread(self, t) source code
 
delServiceThread(self, t) source code
 
shutdown(self, should_wait_cb=None)
Shutdown the Ganga session.
source code
Class Variables [hide private]
  _attributes = 'SHUTDOWN_TIMEOUT'
  _instance = <Ganga.Core.GangaThread.GangaThreadPool.GangaThrea...
  getInstance = <Ganga.Core.GangaThread.GangaThreadPool.Singleto...
Method Details [hide private]

shutdown(self, should_wait_cb=None)

source code 
Shutdown the Ganga session.

@param should_wait_cb: A callback function with the following signature
    should_wait_cb(total_time, critical_thread_ids, non_critical_thread_ids)
    where
        total_time is the time in seconds since shutdown started
        critical_thread_ids is a list of alive critical thread names
        non_critical_thread_ids is a list of alive non-critical threads names.
    and
        return value is evaluated as a boolean. 

A shutdown thread is started that calls stop() on each GangaThread and
waits for them all to die. A loop waits for the shutdown thread to
die, periodically calling the should_wait_cb function to ask if it
should continue to wait or shutdown anyway.


Class Variable Details [hide private]

_instance

Value:
<Ganga.Core.GangaThread.GangaThreadPool.GangaThreadPool instance at 0x\
23d4248>

getInstance

Value:
<Ganga.Core.GangaThread.GangaThreadPool.SingletonHelper instance at 0x\
23daf80>