IGLib 1.4
The IGLib base library for development of numerical, technical and business applications.

IG::Lib::TrackedThread Class Reference

Tracked thread object that wraps a single created thread and enables that all active wrapped threads are are tracked (i.e. a list of all active tracked threads can be obtained at any time). Starting and manipulatin of the wrapped thread is tone through the TrackedThread.Thread property.The TrackedThread.IsParameterizedStart property can be used if the wrapped thread was created with the parameterized thread start delegate.The static TrackedThread.Threads property returns an array of all TrackedThread objects that have ever been created and wrap active threads (threads that complete are removed from the list). More...

List of all members.

Public Member Functions

 TrackedThread (ParameterizedThreadStart start)
 Creates a new tracked thread with the specified parameterized thread start delegate.
 TrackedThread (ThreadStart start)
 Creates a new tracked thread with the specified thread start delegate.
 TrackedThread (ParameterizedThreadStart start, int maxStackSize)
 Creates a new tracked thread with the specified parameterized thread start delegate and the specified maximal stack size.
 TrackedThread (ThreadStart start, int maxStackSize)
 Creates a new tracked thread with the specified thread start delegate and the specified maximal stack size.

Static Public Member Functions

static void Test ()
 Tests and demonstrates the TrackedThread class.

Protected Member Functions

void StartThreadParameterized (object obj)
 The parameterized start method of the current tracked thread. Calls the delegate that has been passed at creation.
void StartThread ()
 The parameterized start method of the current tracked thread. Calls the delegate that has been passed at creation.

Protected Attributes

readonly Thread _thread
readonly ParameterizedThreadStart _startParameterized
 Parameterized start delegate, executed on the thread when it starts.
readonly ThreadStart _start
 Start delegate (nonparameterized), executed on the thread when it starts.

Static Protected Attributes

static readonly object _lockThreadList = new object()
 Object for locking the list of active traced threads.
static readonly List
< TrackedThread
_threadList = new List<TrackedThread>()
 The list of active traced threads.

Properties

Thread Thread [get]
 Gets the thread that is uses in this object.
bool IsParameterizedStart [get]
 Gets the flag indicating whether the current traced thread uses a parameterized thread start.
static TrackedThread[] Threads [get]
 Returns the array of all active tracked threads of type TrackedThread. Use the TrackedThread.Thread property on the elements of the returned array in order to manipulate individual tracked threads.
static int Count [get]
 Gets the current number of active traced threads.

Static Private Member Functions

static void DoNothingForFiveSeconds ()
static void DoNothingForTenSeconds ()
static void DoNothingForSomeTime (object seconds)

Detailed Description

Tracked thread object that wraps a single created thread and enables that all active wrapped threads are are tracked (i.e. a list of all active tracked threads can be obtained at any time).

Starting and manipulatin of the wrapped thread is tone through the TrackedThread.Thread property.

The TrackedThread.IsParameterizedStart property can be used if the wrapped thread was created with the parameterized thread start delegate.

The static TrackedThread.Threads property returns an array of all TrackedThread objects that have ever been created and wrap active threads (threads that complete are removed from the list).

$A Igor xx;


Constructor & Destructor Documentation

IG::Lib::TrackedThread::TrackedThread ( ParameterizedThreadStart  start) [inline]

Creates a new tracked thread with the specified parameterized thread start delegate.

Parameters:
startThe ParameterizedThreadStart delegate that is called on thread start.
IG::Lib::TrackedThread::TrackedThread ( ThreadStart  start) [inline]

Creates a new tracked thread with the specified thread start delegate.

Parameters:
startThe ThreadStart delegate that is called on thread start.
IG::Lib::TrackedThread::TrackedThread ( ParameterizedThreadStart  start,
int  maxStackSize 
) [inline]

Creates a new tracked thread with the specified parameterized thread start delegate and the specified maximal stack size.

Parameters:
startThe ParameterizedThreadStart delegate that is called on thread start.
maxStackSizeMaximal stack size of the thread.
IG::Lib::TrackedThread::TrackedThread ( ThreadStart  start,
int  maxStackSize 
) [inline]

Creates a new tracked thread with the specified thread start delegate and the specified maximal stack size.

Parameters:
startThe ThreadStart delegate that is called on thread start.
maxStackSizeMaximal stack size of the thread.

Member Function Documentation

void IG::Lib::TrackedThread::StartThreadParameterized ( object  obj) [inline, protected]

The parameterized start method of the current tracked thread. Calls the delegate that has been passed at creation.

Parameters:
objObject that is passed as argument to the delegate that is called on thread start.
void IG::Lib::TrackedThread::StartThread ( ) [inline, protected]

The parameterized start method of the current tracked thread. Calls the delegate that has been passed at creation.

static void IG::Lib::TrackedThread::Test ( ) [inline, static]

Tests and demonstrates the TrackedThread class.

static void IG::Lib::TrackedThread::DoNothingForFiveSeconds ( ) [inline, static, private]
static void IG::Lib::TrackedThread::DoNothingForTenSeconds ( ) [inline, static, private]
static void IG::Lib::TrackedThread::DoNothingForSomeTime ( object  seconds) [inline, static, private]

Member Data Documentation

readonly Thread IG::Lib::TrackedThread::_thread [protected]
readonly ParameterizedThreadStart IG::Lib::TrackedThread::_startParameterized [protected]

Parameterized start delegate, executed on the thread when it starts.

readonly ThreadStart IG::Lib::TrackedThread::_start [protected]

Start delegate (nonparameterized), executed on the thread when it starts.

readonly object IG::Lib::TrackedThread::_lockThreadList = new object() [static, protected]

Object for locking the list of active traced threads.

readonly List<TrackedThread> IG::Lib::TrackedThread::_threadList = new List<TrackedThread>() [static, protected]

The list of active traced threads.


Property Documentation

Thread IG::Lib::TrackedThread::Thread [get]

Gets the thread that is uses in this object.

bool IG::Lib::TrackedThread::IsParameterizedStart [get]

Gets the flag indicating whether the current traced thread uses a parameterized thread start.

TrackedThread [] IG::Lib::TrackedThread::Threads [static, get]

Returns the array of all active tracked threads of type TrackedThread. Use the TrackedThread.Thread property on the elements of the returned array in order to manipulate individual tracked threads.

int IG::Lib::TrackedThread::Count [static, get]

Gets the current number of active traced threads.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties Events