Somewhat generic queue processing class to establish a producer consumer queue.
More...
|
| ThreadQueue (const char *id, int pri, size_t stack=0) |
| Create instance of our queue and give it a process priority. More...
|
|
virtual | ~ThreadQueue () |
| Destroy the queue. More...
|
|
void | setTimer (timeout_t timeout) |
| Set the queue timeout. More...
|
|
void | post (const void *data, unsigned len) |
| Put some unspecified data into this queue. More...
|
|
| Mutex (const char *name=NULL) |
| The mutex is always initialized as a recursive entity. More...
|
|
virtual | ~Mutex () |
| Destroying the mutex removes any system resources associated with it. More...
|
|
void | nameMutex (const char *name) |
| Enable setting of mutex name for deadlock debug. More...
|
|
void | enterMutex (void) |
| Entering a Mutex locks the mutex for the current thread. More...
|
|
void | enter (void) |
| Future abi will use enter/leave/test members. More...
|
|
void | leave (void) |
| Future abi will use enter/leave/test members. More...
|
|
bool | test (void) |
| Future abi will use enter/leave/test members. More...
|
|
bool | tryEnterMutex (void) |
| Tries to lock the mutex for the current thread. More...
|
|
void | leaveMutex (void) |
| Leaving a mutex frees that mutex for use by another thread. More...
|
|
| Thread (bool isMain) |
| This is actually a special constructor that is used to create a thread "object" for the current execution context when that context is not created via an instance of a derived Thread object itself. More...
|
|
| Thread (int pri=0, size_t stack=0) |
| When a thread object is contructed, a new thread of execution context is created. More...
|
|
| Thread (const Thread &th) |
| A thread of execution can also be specified by cloning an existing thread. More...
|
|
virtual | ~Thread () |
| The thread destructor should clear up any resources that have been allocated by the thread. More...
|
|
int | start (Semaphore *start=0) |
| When a new thread is created, it does not begin immediate execution. More...
|
|
int | detach (Semaphore *start=0) |
| Start a new thread as "detached". More...
|
|
Thread * | getParent (void) |
| Gets the pointer to the Thread class which created the current thread object. More...
|
|
void | suspend (void) |
| Suspends execution of the selected thread. More...
|
|
void | resume (void) |
| Resumes execution of the selected thread. More...
|
|
Cancel | getCancel (void) |
| Used to retrieve the cancellation mode in effect for the selected thread. More...
|
|
bool | isRunning (void) const |
| Verifies if the thread is still running or has already been terminated but not yet deleted. More...
|
|
bool | isDetached (void) const |
| Check if this thread is detached. More...
|
|
void | join (void) |
| Blocking call which unlocks when thread terminates. More...
|
|
bool | isThread (void) const |
| Tests to see if the current execution context is the same as the specified thread object. More...
|
|
cctid_t | getId (void) const |
| Get system thread numeric identifier. More...
|
|
const char * | getName (void) const |
| Get the name string for this thread, to use in debug messages. More...
|
|
| Semaphore (unsigned resource=0) |
| The initial value of the semaphore can be specified. More...
|
|
virtual | ~Semaphore () |
| Destroying a semaphore also removes any system resources associated with it. More...
|
|
bool | wait (timeout_t timeout=0) |
| Wait is used to keep a thread held until the semaphore counter is greater than 0. More...
|
|
void | post (void) |
| Posting to a semaphore increments its current value and releases the first thread waiting for the semaphore if it is currently at 0. More...
|
|
void | force_unlock_after_cancellation () |
| Call it after a deferred cancellation to avoid deadlocks. More...
|
|
|
virtual void | final () |
|
virtual void | startQueue (void) |
| Start of dequeing. More...
|
|
virtual void | stopQueue (void) |
| End of dequeing, we expect the queue is empty for now. More...
|
|
virtual void | onTimer (void) |
| A derivable method to call when the timout is expired. More...
|
|
virtual void | runQueue (void *data)=0 |
| Virtual callback method to handle processing of a queued data items. More...
|
|
void | setName (const char *text) |
| Set the name of the current thread. More...
|
|
virtual void | initial (void) |
| The initial method is called by a newly created thread when it starts execution. More...
|
|
virtual void * | getExtended (void) |
| Since getParent() and getThread() only refer to an object of the Thread "base" type, this virtual method can be replaced in a derived class with something that returns data specific to the derived class that can still be accessed through the pointer returned by getParent() and getThread(). More...
|
|
virtual void | notify (Thread *) |
| When a thread terminates, it now sends a notification message to the parent thread which created it. More...
|
|
void | exit (void) |
| Used to properly exit from a Thread derived run() or initial() method. More...
|
|
void | sync (void) |
| Used to wait for a join or cancel, in place of explicit exit. More...
|
|
bool | testCancel (void) |
| test a cancellation point for deferred thread cancellation. More...
|
|
void | setCancel (Cancel mode) |
| Sets thread cancellation mode. More...
|
|
void | setSuspend (Suspend mode) |
| Sets the thread's ability to be suspended from execution. More...
|
|
void | terminate (void) |
| Used by another thread to terminate the current thread. More...
|
|
void | clrParent (void) |
| clear parent thread relationship. More...
|
|
Somewhat generic queue processing class to establish a producer consumer queue.
This may be used to buffer cdr records, or for other purposes where an in-memory queue is needed for rapid posting. This class is derived from Mutex and maintains a linked list. A thread is used to dequeue data and pass it to a callback method that is used in place of "run" for each item present on the queue. The conditional is used to signal the run thread when new data is posted.
This class was changed by Angelo Naselli to have a timeout on the queue
in memory data queue interface.
- Author
- David Sugar dyfet.nosp@m.@ost.nosp@m.el.co.nosp@m.m