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

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Properties | Static Private Member Functions | List of all members
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). More...

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

## Static Public Member Functions
static void | Test ()
| Tests and demonstrates the TrackedThread class. More...

## 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. More...
void | StartThread ()
| The parameterized start method of the current tracked thread. Calls the delegate that has been passed at creation. More...

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

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

## Properties
Thread | Thread`[get]`
| Gets the thread that is uses in this object. More...
bool | IsParameterizedStart`[get]`
| Gets the flag indicating whether the current traced thread uses a parameterized thread start. More...
static TrackedThread[] | Threads`[get]`
| Returns the array of all active tracked threads of type TrackedThread. More...
static int | Count`[get]`
| Gets the current number of active traced threads. More...

## 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 done 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

  start | The 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

  start | The 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

  start | The ParameterizedThreadStart delegate that is called on thread start.
  maxStackSize | Maximal 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

  start | The ThreadStart delegate that is called on thread start.
  maxStackSize | Maximal 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

  obj | Object 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.

References IG.Lib.TrackedThread.Count, and IG.Lib.TrackedThread.Thread.

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.

Referenced by IG.Lib.TrackedThread.Test().

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.

Referenced by IG.Lib.TrackedThread.Test().

The documentation for this class was generated from the following file:

- igbase/numeric/parallel/threadutils/TracedThread.cs