Joypad Scol plugin
|
#include <ou_thread.h>
Public Member Functions | |
Thread () | |
Thread (const char *nm) | |
virtual | ~Thread () |
void | setName (const char *nm) |
std::string | getName () const |
void | start () |
virtual void | run () |
void | sleep (long ms) |
void | suspend () |
void | resume () |
void | stop () |
void | setPriority (int p) |
bool | wait (const char *m, long ms=5000) |
void | release (const char *m) |
Static Public Attributes | |
static const int | P_ABOVE_NORMAL = THREAD_PRIORITY_ABOVE_NORMAL |
static const int | P_BELOW_NORMAL = THREAD_PRIORITY_BELOW_NORMAL |
static const int | P_HIGHEST = THREAD_PRIORITY_HIGHEST |
static const int | P_IDLE = THREAD_PRIORITY_IDLE |
static const int | P_LOWEST = THREAD_PRIORITY_LOWEST |
static const int | P_NORMAL = THREAD_PRIORITY_NORMAL |
static const int | P_CRITICAL = THREAD_PRIORITY_TIME_CRITICAL |
class Thread Represents a thread of execution in the process. To create a new Thread write an inherited class ot Thread and override the run() function
Definition at line 52 of file ou_thread.h.
Thread::Thread | ( | ) |
@ The Thread class implementation @/
/** Thread() default constructor
Definition at line 63 of file ou_thread.cpp.
Thread::Thread | ( | const char * | nm | ) |
Thread(const char* nm) overloaded constructor creates a Thread object identified by "nm"
Definition at line 72 of file ou_thread.cpp.
|
virtual |
Definition at line 77 of file ou_thread.cpp.
string Thread::getName | ( | ) | const |
getName() return the Thread object's name as a string
Definition at line 93 of file ou_thread.cpp.
void Thread::release | ( | const char * | m | ) |
release(const char* m)
releases the mutex "m" and makes it available for other threads
Definition at line 207 of file ou_thread.cpp.
void Thread::resume | ( | ) |
resume()
resumes a suspended thread
Definition at line 168 of file ou_thread.cpp.
|
virtual |
run() called by the thread callback _ou_thread_proc() to be overridden by child classes of Thread
Definition at line 101 of file ou_thread.cpp.
void Thread::setName | ( | const char * | nm | ) |
setName(const char* nm) sets the Thread object's name to "nm"
Definition at line 86 of file ou_thread.cpp.
void Thread::setPriority | ( | int | tp | ) |
setPriority(int tp) sets the priority of the thread to "tp" "tp" must be a valid priority defined in the Thread class
Definition at line 142 of file ou_thread.cpp.
void Thread::sleep | ( | long | ms | ) |
sleep(long ms) holds back the thread's execution for "ms" milliseconds
Definition at line 109 of file ou_thread.cpp.
void Thread::start | ( | ) |
start() creates a low-level thread object and calls the run() function
Definition at line 117 of file ou_thread.cpp.
void Thread::stop | ( | ) |
stop() stops the running thread and frees the thread handle
Definition at line 130 of file ou_thread.cpp.
void Thread::suspend | ( | ) |
suspend()
suspends the thread
Definition at line 155 of file ou_thread.cpp.
bool Thread::wait | ( | const char * | m, |
long | ms = 5000 |
||
) |
wait(const char* m,long ms)
makes the thread suspend execution until the mutex represented by "m" is released by another thread. "ms" specifies a time-out for the wait operation. "ms" defaults to 5000 milli-seconds
Definition at line 184 of file ou_thread.cpp.
|
static |
Definition at line 80 of file ou_thread.h.
|
static |
Definition at line 81 of file ou_thread.h.
|
static |
Definition at line 86 of file ou_thread.h.
|
static |
Definition at line 82 of file ou_thread.h.
|
static |
Definition at line 83 of file ou_thread.h.
|
static |
Definition at line 84 of file ou_thread.h.
|
static |
Definition at line 85 of file ou_thread.h.