C# Class Universe.Framework.Utilities.ThreadMonitor

Show file Open project: Virtual-Universe/Virtual-Universe

Protected Properties

Property Type Description
m_heartbeats List
m_lock Object
m_thread Thread
m_timesToIterate int

Public Methods

Method Description
CallAndWait ( int timeout, Heartbeat enumerator, bool &isRunning ) : bool

Call the method and wait for it to complete or the max time.

StartMonitor ( int timesToIterate, int sleepTime ) : void

Start the thread and run through the threads that are given.

StartTrackingThread ( int millisecondTimeOut, Heartbeat hb ) : void

Add this delegate to the tracker so that it can run.

Stop ( ) : void

Protected Methods

Method Description
Run ( ) : void

Run the loop through the heartbeats.

Method Details

CallAndWait() public static method

Call the method and wait for it to complete or the max time.
public static CallAndWait ( int timeout, Heartbeat enumerator, bool &isRunning ) : bool
timeout int
enumerator Heartbeat
isRunning bool
return bool

Run() protected method

Run the loop through the heartbeats.
protected Run ( ) : void
return void

StartMonitor() public method

Start the thread and run through the threads that are given.
public StartMonitor ( int timesToIterate, int sleepTime ) : void
timesToIterate int /// The number of times to run the delegate. /// /// If you set this parameter to 0, it will loop infinitely. /// ///
sleepTime int /// The sleep time between each iteration. /// /// If you set this parameter to 0, it will loop without sleeping at all. /// The sleeping will have to be deal with in the delegates. /// ///
return void

StartTrackingThread() public method

Add this delegate to the tracker so that it can run.
public StartTrackingThread ( int millisecondTimeOut, Heartbeat hb ) : void
millisecondTimeOut int The time that the thread can run before it is forcefully stopped.
hb Heartbeat The delegate to run.
return void

Stop() public method

public Stop ( ) : void
return void

Property Details

m_heartbeats protected property

protected List m_heartbeats
return List

m_lock protected property

protected Object m_lock
return Object

m_thread protected property

protected Thread m_thread
return Thread

m_timesToIterate protected property

protected int m_timesToIterate
return int