Home   Information   Classes   Download   Usage   Mail List   Requirements   Tutorial


Thread Class Reference

STK thread class. More...

#include <Thread.h>

Inheritance diagram for Thread::

Stk List of all members.

Public Methods

 Thread ()
 Default constructor.

 ~Thread ()
 The class destructor waits indefinitely for the thread to end before returning.

bool start (THREAD_FUNCTION routine, void *ptr=NULL)
 Begin execution of the thread routine. Upon success, TRUE is returned. More...

bool wait (long milliseconds=-1)
 Wait the specified number of milliseconds for the thread to terminate. Return TRUE on success. More...


Static Public Methods

void test (void)
 Test for a thread cancellation request.


Detailed Description

STK thread class.

This class provides a uniform interface for cross-platform threads. On unix systems, the pthread library is used. Under Windows, the C runtime threadex functions are used.

by Perry R. Cook and Gary P. Scavone, 1995 - 2002.


Member Function Documentation

bool Thread::start ( THREAD_FUNCTION routine,
void * ptr = NULL )
 

Begin execution of the thread routine. Upon success, TRUE is returned.

The thread routine can be passed an argument via ptr. If the thread cannot be created, the return value is FALSE.

bool Thread::wait ( long milliseconds = -1 )
 

Wait the specified number of milliseconds for the thread to terminate. Return TRUE on success.

If the specified time value is negative, the function will block indefinitely. Otherwise, the function will block up to a maximum of the specified time. A return value of FALSE indicates the thread did not terminate within the specified time limit.


The documentation for this class was generated from the following file:
The Synthesis ToolKit in C++ (STK)
©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved.