North State Framework in C#  V3.0.0
An object-oriented framework for implementing UML state machines.
Public Member Functions | Static Public Member Functions | Properties | List of all members
NSFOSThread Class Reference

Represents an operating system thread. More...

Inheritance diagram for NSFOSThread:
NSFTaggedObject NSFUniquelyNumberedObject INSFNamedObject

Public Member Functions

 NSFOSThread (NSFString name, NSFVoidAction< NSFContext > executionAction)
 Creates an operating system thread. More...
 
 NSFOSThread (NSFString name, NSFVoidAction< NSFContext > executionAction, int priority)
 Creates an operating system thread in the .Net environment. More...
 
void executeAction ()
 Executes the thread execution action. More...
 
void startThread ()
 Starts the thread by calling its execution action. More...
 
- Public Member Functions inherited from NSFTaggedObject
 NSFTaggedObject (NSFString name)
 Creates an object with a unique id and a name. More...
 
- Public Member Functions inherited from NSFUniquelyNumberedObject
 NSFUniquelyNumberedObject ()
 Creates a uniquely numbered object. More...
 
bool isSameObject (NSFUniquelyNumberedObject other)
 Checks if this object is the same as another object. More...
 

Static Public Member Functions

static NSFOSThread create (NSFString name, NSFVoidAction< NSFContext > executionAction)
 Creates an operating system thread. More...
 
static NSFOSThread create (NSFString name, NSFVoidAction< NSFContext > executionAction, int priority)
 Creates an operating system thread. More...
 
static void sleep (UInt32 sleepTime)
 Sleeps the calling thread for the specified number of milliseconds. More...
 
- Static Public Member Functions inherited from NSFUniquelyNumberedObject
static NSFId getNextUniqueId ()
 Gets the next unique id. More...
 

Properties

static int HighestPriority [get]
 Gets the value for the highest priority thread. More...
 
static int HighPriority [get]
 Gets the value for a high priority thread. More...
 
static int MediumPriority [get]
 Gets the value for a medium priority thread. More...
 
static int LowPriority [get]
 Gets the value for a low priority thread. More...
 
static int LowestPriority [get]
 Gets the value for the lowest priority thread. More...
 
int Priority [get, set]
 Gets or sets the priority of the thread. More...
 
int OSThreadId [get, set]
 Gets the operating system specific thread id. More...
 
- Properties inherited from NSFTaggedObject
NSFString Name [get, set]
 
- Properties inherited from NSFUniquelyNumberedObject
NSFId UniqueId [get]
 Gets or sets the unique id of the object. More...
 
- Properties inherited from INSFNamedObject
NSFString Name [get]
 Gets the name of the object. More...
 

Detailed Description

Represents an operating system thread.

Constructor & Destructor Documentation

NSFOSThread ( NSFString  name,
NSFVoidAction< NSFContext executionAction 
)

Creates an operating system thread.

Parameters
nameThe name for the thread.
executionActionThe action executed by the thread.
Returns
The new thread.

The thread execution action is typically an execution loop. When the action returns, the thread is terminated.

NSFOSThread ( NSFString  name,
NSFVoidAction< NSFContext executionAction,
int  priority 
)

Creates an operating system thread in the .Net environment.

Parameters
nameThe name for the thread.
executionActionThe action executed by the thread.
priorityThe priority of the thread.
Returns
The new thread.

The thread execution action is typically an execution loop. When the action returns, the thread is terminated.

Member Function Documentation

static NSFOSThread create ( NSFString  name,
NSFVoidAction< NSFContext executionAction 
)
static

Creates an operating system thread.

Parameters
nameThe name for the thread.
executionActionThe action executed by the thread.
Returns
The new thread.

The thread execution action is typically an execution loop. When the action returns, the thread is terminated. This method is included for interface compatibility with other language implementations.

static NSFOSThread create ( NSFString  name,
NSFVoidAction< NSFContext executionAction,
int  priority 
)
static

Creates an operating system thread.

Parameters
nameThe name for the thread.
executionActionThe action executed by the thread.
priorityThe priority of the thread.
Returns
The new thread.

The thread execution action is typically an execution loop. When the action returns, the thread is terminated. This method is included for interface compatibility with other language implementations.

void executeAction ( )

Executes the thread execution action.

The thread execution action is typically an execution loop. When the action returns, the thread is terminated. Derived classes should call this method from their thread entry method. This method should not be called in any other circumnstances.

static void sleep ( UInt32  sleepTime)
static

Sleeps the calling thread for the specified number of milliseconds.

Parameters
sleepTimeTime to sleep in milliseconds.

This method sleeps the calling thread, not the thread object on which it is called. A sleep time of zero has OS defined behavior.

void startThread ( )

Starts the thread by calling its execution action.

Property Documentation

int HighestPriority
staticget

Gets the value for the highest priority thread.

Returns
The highest thread priority.

This methods returns the highest priority that an NSFOSThread may have. The system may support higher thread priorities which are reserved for system use. Only the NSFOSTimer should use this priority level.

int HighPriority
staticget

Gets the value for a high priority thread.

Returns
The high thread priority.

Use the Priority property to set a threads priority.

int LowestPriority
staticget

Gets the value for the lowest priority thread.

Returns
The lowest thread priority.

This methods returns the lowest priority that an NSFOSThread may have. The system may support lower thread priorities which are reserved for system use.

int LowPriority
staticget

Gets the value for a low priority thread.

Returns
The low thread priority.

Use the Priority property to set a threads priority.

int MediumPriority
staticget

Gets the value for a medium priority thread.

Returns
The medium thread priority.

Use the Priority property to set a threads priority.

int OSThreadId
getset

Gets the operating system specific thread id.

Returns
The OS specific thread id.
int Priority
getset

Gets or sets the priority of the thread.

This property specifies the priority of the thread.




Copyright 2004-2014, North State Software, LLC. All rights reserved.