version 1.93, 2006/08/21 08:48:20
|
version 1.94, 2006/08/21 15:31:03
|
|
|
void Thread::cancel() | void Thread::cancel() |
{ | { |
_cancelled = true; | _cancelled = true; |
pthread_cancel(_handle.thid.tt_handle()); |
pthread_cancel(_handle.thid.thread); |
} | } |
| |
void Thread::test_cancel() | void Thread::test_cancel() |
|
|
#if defined(PEGASUS_PLATFORM_LINUX_GENERIC_GNU) | #if defined(PEGASUS_PLATFORM_LINUX_GENERIC_GNU) |
void Thread::suspend() | void Thread::suspend() |
{ | { |
pthread_kill(_handle.thid.tt_handle(), SIGSTOP); |
pthread_kill(_handle.thid.thread, SIGSTOP); |
} | } |
| |
void Thread::resume() | void Thread::resume() |
{ | { |
pthread_kill(_handle.thid.tt_handle(), SIGCONT); |
pthread_kill(_handle.thid.thread, SIGCONT); |
} | } |
#endif | #endif |
| |
|
|
| |
void Thread::join(void) | void Thread::join(void) |
{ | { |
if (!_is_detached && Threads::id(_handle.thid) != 0) |
if (!_is_detached && !Threads::null(_handle.thid)) |
pthread_join(_handle.thid.tt_handle(), &_exit_code); |
pthread_join(_handle.thid.thread, &_exit_code); |
| |
Threads::clear(_handle.thid); | Threads::clear(_handle.thid); |
} | } |
|
|
{ | { |
_is_detached = true; | _is_detached = true; |
#if defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) | #if defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) |
pthread_t thread_id=_handle.thid.tt_handle(); |
pthread_t thread_id=_handle.thid.thread; |
pthread_detach(&thread_id); | pthread_detach(&thread_id); |
#else | #else |
pthread_detach(_handle.thid.tt_handle()); |
pthread_detach(_handle.thid.thread); |
#endif | #endif |
} | } |
| |