#include <IArchMultithread.h>
Inherits IInterface.
Inherited by CArch, CArchMultithreadPosix, and CArchMultithreadWindows.
Inheritance diagram for IArchMultithread:
Public Types | |
typedef void *(* | ThreadFunc )(void *) |
Type of thread entry point. | |
typedef unsigned int | ThreadID |
Type of thread identifier. | |
typedef void(* | SignalFunc )(ESignal, void *userData) |
Type of signal handler function. | |
enum | ESignal { kINTERRUPT, kTERMINATE, kHANGUP, kUSER, kNUM_SIGNALS } |
Types of signals. More... | |
Public Member Functions | |
manipulators | |
virtual CArchCond | newCondVar ()=0 |
Create a condition variable. | |
virtual void | closeCondVar (CArchCond)=0 |
Destroy a condition variable. | |
virtual void | signalCondVar (CArchCond)=0 |
Signal a condition variable. | |
virtual void | broadcastCondVar (CArchCond)=0 |
Broadcast a condition variable. | |
virtual bool | waitCondVar (CArchCond, CArchMutex, double timeout)=0 |
Wait on a condition variable. | |
virtual CArchMutex | newMutex ()=0 |
Create a recursive mutex. | |
virtual void | closeMutex (CArchMutex)=0 |
Destroy a mutex. | |
virtual void | lockMutex (CArchMutex)=0 |
Lock a mutex. | |
virtual void | unlockMutex (CArchMutex)=0 |
Unlock a mutex. | |
virtual CArchThread | newThread (ThreadFunc func, void *userData)=0 |
Start a new thread. | |
virtual CArchThread | newCurrentThread ()=0 |
Get a reference to the calling thread. | |
virtual CArchThread | copyThread (CArchThread thread)=0 |
Copy a thread object. | |
virtual void | closeThread (CArchThread)=0 |
Release a thread reference. | |
virtual void | cancelThread (CArchThread thread)=0 |
Force a thread to exit. | |
virtual void | setPriorityOfThread (CArchThread, int n)=0 |
Change thread priority. | |
virtual void | testCancelThread ()=0 |
Cancellation point. | |
virtual bool | wait (CArchThread thread, double timeout)=0 |
Wait for a thread to exit. | |
virtual bool | isSameThread (CArchThread, CArchThread)=0 |
Compare threads. | |
virtual bool | isExitedThread (CArchThread thread)=0 |
Test if thread exited. | |
virtual void * | getResultOfThread (CArchThread thread)=0 |
Returns the exit code of a thread. | |
virtual ThreadID | getIDOfThread (CArchThread thread)=0 |
Returns an ID for a thread. | |
virtual void | setSignalHandler (ESignal, SignalFunc func, void *userData)=0 |
Set the interrupt handler. | |
virtual void | raiseSignal (ESignal signal)=0 |
Invoke the signal handler. |
This interface defines the multithreading operations required by synergy. Each architecture must implement this interface.
Definition at line 68 of file IArchMultithread.h.
|
Types of signals. Not all platforms support all signals. Unsupported signals are ignored.
Definition at line 79 of file IArchMultithread.h. |
|
Broadcast a condition variable. Broadcasting a condition variable releases all waiting threads. Implemented in CArch, CArchMultithreadPosix, and CArchMultithreadWindows. Referenced by CArch::broadcastCondVar(). |
|
Force a thread to exit.
Causes Implemented in CArch, CArchMultithreadPosix, and CArchMultithreadWindows. Referenced by CArch::cancelThread(). |
|
Release a thread reference. Deletes the given thread object. This does not destroy the thread the object referred to, even if there are no remaining references. Use cancelThread() and waitThread() to stop a thread and wait for it to exit. Implemented in CArch, CArchMultithreadPosix, and CArchMultithreadWindows. Referenced by CArch::closeThread(). |
|
Copy a thread object.
Returns a reference to to thread referred to by Implemented in CArch, CArchMultithreadPosix, and CArchMultithreadWindows. Referenced by CArch::copyThread(). |
|
Returns an ID for a thread.
Returns some ID number for Implemented in CArch, CArchMultithreadPosix, and CArchMultithreadWindows. Referenced by CArch::getIDOfThread(). |
|
Returns the exit code of a thread.
Waits indefinitely for (Cancellation point) Implemented in CArch, CArchMultithreadPosix, and CArchMultithreadWindows. Referenced by CArch::getResultOfThread(). |
|
Test if thread exited.
Returns true iff Implemented in CArch, CArchMultithreadPosix, and CArchMultithreadWindows. Referenced by CArch::isExitedThread(). |
|
Compare threads. Returns true iff two thread objects refer to the same thread. Note that comparing thread objects directly is meaningless. Implemented in CArch, CArchMultithreadPosix, and CArchMultithreadWindows. Referenced by CArch::isSameThread(). |
|
Create a condition variable. The condition variable is an opaque data type. Implemented in CArch, CArchMultithreadPosix, and CArchMultithreadWindows. Referenced by CArch::newCondVar(). |
|
Get a reference to the calling thread. Returns a thread representing the current (i.e. calling) thread. Implemented in CArch, CArchMultithreadPosix, and CArchMultithreadWindows. Referenced by CArch::newCurrentThread(). |
|
Create a recursive mutex. Creates a recursive mutex. A thread may lock a recursive mutex when it already holds a lock on that mutex. The mutex is an opaque data type. Implemented in CArch, CArchMultithreadPosix, and CArchMultithreadWindows. Referenced by CArch::newMutex(). |
|
Start a new thread.
Creates and starts a new thread, using Implemented in CArch, CArchMultithreadPosix, and CArchMultithreadWindows. Referenced by CArch::newThread(). |
|
Invoke the signal handler.
Invokes the signal handler for Implemented in CArch, CArchMultithreadPosix, and CArchMultithreadWindows. Referenced by CArch::raiseSignal(). |
|
Change thread priority.
Changes the priority of Implemented in CArch, CArchMultithreadPosix, and CArchMultithreadWindows. Referenced by CArch::setPriorityOfThread(). |
|
Set the interrupt handler.
Sets the function to call on receipt of an external interrupt. By default and when Implemented in CArch, CArchMultithreadPosix, and CArchMultithreadWindows. Referenced by CArch::setSignalHandler(). |
|
Signal a condition variable. Signalling a condition variable releases one waiting thread. Implemented in CArch, CArchMultithreadPosix, and CArchMultithreadWindows. Referenced by CArch::signalCondVar(). |
|
Cancellation point. This method does nothing but is a cancellation point. Clients can make their own functions cancellation points by calling this method at appropriate times. (Cancellation point) Implemented in CArch, CArchMultithreadPosix, and CArchMultithreadWindows. Referenced by CArch::testCancelThread(). |
|
Wait for a thread to exit.
Waits for up to (Cancellation point) Implemented in CArch, CArchMultithreadPosix, and CArchMultithreadWindows. Referenced by CArch::wait(). |
|
Wait on a condition variable.
Wait on a conditation variable for up to (Cancellation point) Implemented in CArch, CArchMultithreadPosix, and CArchMultithreadWindows. Referenced by CArch::waitCondVar(). |