Inheritance diagram for phThread:
A phThread should always be allocated with the new operator. Allocating a thread class on the stack s possible but if it is meant to be a detached thread it can lead to an attempt at deleting stack memory which will likely segfault the process.
Phission implements it's own C++ thread to be able to port to any unsupported thread API. It started off as being a simple wrapper around pthreads and was refined to be a union of Win32 threads and pthread ideas. The resulting phThread interface lent itself very easily to being ported to the VisualDSP++ Kernel thread API.
Phission's design is centered heavily on the idea of many specific purpose threads. It was very necessary to have a custom thread class to be sure everything about the system was designed with certain features.
Phission doesn't allow the 'canceling' of threads because it is bad coding practice to stop a thread dead in it's tracks without having that thread clean up or release it's allocated resources.
The Phission thread implementation adds specific methods that are not available in other thread implementations. These include the following methods which should not be called by any code:
The following methods (including those mentioned above) should not be called by a spawned thread on it's own phThread class instance:
The phThread::exit method can only be called from the current thread's phThread instance.
Definition at line 154 of file phThread.h.
Public Member Functions
|int||start (int flag=phNOFLAG)|
|void||setRunning (int running)|
|int||setPriority (int priority, int flag)|
|void||exit (uint32_t value=0)|
|int||equal (phThread &thread)|
Static Public Member Functions
|static int||same (phThread &thread_one, phThread &thread_two)|
|static void||forcedExit ()|
Protected Member Functions
|virtual int||run ()|
|virtual int||setup ()|
|virtual int||wakeup ()|
|virtual int||cleanup ()|
|virtual int||error ()|
Static Private Member Functions
|static void *||entry (void *param)|
|Copyright (C) 2002 - 2007||
Philip D.S. Thoren ( email@example.com )
University Of Massachusetts at Lowell