version 1.1.2.3, 2001/07/30 18:03:10
|
version 1.1.2.4, 2001/07/31 12:54:35
|
|
|
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
#include "Thread.h" | #include "Thread.h" |
|
#include <Pegasus/Common/IPC.h> |
| |
#if defined(PEGASUS_OS_TYPE_WINDOWS) | #if defined(PEGASUS_OS_TYPE_WINDOWS) |
# include "ThreadWindows.cpp" | # include "ThreadWindows.cpp" |
|
|
} | } |
| |
#endif | #endif |
thread_data *Thread::put_tsd(Sint8 *key, void (*delete_func)(void *), Uint32 size, void *value) throw(IPCException) |
|
{ |
|
PEGASUS_ASSERT(key != NULL); |
//thread_data *Thread::put_tsd(Sint8 *key, void (*delete_func)(void *), Uint32 size, void *value) throw(IPCException) |
PEGASUS_ASSERT(delete_func != NULL); |
|
thread_data *tsd ; |
|
tsd = _tsd.remove((void *)key); // may throw an IPC exception |
|
thread_data *ntsd = new thread_data(key); |
|
ntsd->put_data(delete_func, size, value); |
|
try { _tsd.insert_first(ntsd); } |
|
catch(IPCException& e) { delete ntsd; throw; } |
|
return(tsd); |
|
} |
|
| |
#ifndef PEGASUS_THREAD_EXIT_NATIVE | #ifndef PEGASUS_THREAD_EXIT_NATIVE |
void Thread::exit_self(PEGASUS_THREAD_RETURN exit_code) | void Thread::exit_self(PEGASUS_THREAD_RETURN exit_code) |
|
|
} | } |
_exit_code = exit_code; | _exit_code = exit_code; |
} | } |
|
|
#endif | #endif |
| |
| |