version 1.1.2.4, 2006/07/28 20:46:41
|
version 1.1.2.8, 2006/07/28 21:26:39
|
|
|
return *this; | return *this; |
} | } |
| |
pthread_t handle() const |
pthread_t tt_handle() const |
{ | { |
return _thread; | return _thread; |
} | } |
|
|
#if defined(PEGASUS_HAVE_WINDOWS_THREADS) | #if defined(PEGASUS_HAVE_WINDOWS_THREADS) |
struct ThreadType | struct ThreadType |
{ | { |
|
ThreadType() : handle(NULL) { } |
|
|
HANDLE handle; | HANDLE handle; |
}; | }; |
typedef unsigned ThreadReturnType; | typedef unsigned ThreadReturnType; |
|
|
| |
static void cleanup_pop(int execute); | static void cleanup_pop(int execute); |
| |
static Uint32 id(const ThreadType& x); |
static Uint32 id(const ThreadType& x = Threads::self()); |
| |
static void clear(ThreadType& x); | static void clear(ThreadType& x); |
}; | }; |
|
|
| |
inline bool Threads::equal(ThreadType x, ThreadType y) | inline bool Threads::equal(ThreadType x, ThreadType y) |
{ | { |
return pthread_equal(x.thread(), y.thread()); |
return pthread_equal(x.tt_handle(), y.tt_handle()); |
} | } |
| |
inline void Threads::exit(ThreadReturnType rc) | inline void Threads::exit(ThreadReturnType rc) |
|
|
| |
inline void Threads::cancel(ThreadType th, ThreadReturnType rc) | inline void Threads::cancel(ThreadType th, ThreadReturnType rc) |
{ | { |
pthread_cancel(th.thread()); |
pthread_cancel(th.tt_handle()); |
} | } |
| |
inline void Threads::yield() | inline void Threads::yield() |