version 1.1.2.3, 2001/07/30 16:38:12
|
version 1.1.2.4, 2001/07/30 18:03:10
|
|
|
public: | public: |
thread_data( Sint8 *key ) : _delete_func(NULL) , _data(NULL), _size(0) | thread_data( Sint8 *key ) : _delete_func(NULL) , _data(NULL), _size(0) |
{ | { |
|
PEGASUS_ASSERT(key != NULL); |
_key = strdup(key) ; | _key = strdup(key) ; |
} | } |
| |
thread_data(Sint8 *key, int size) | thread_data(Sint8 *key, int size) |
{ | { |
|
PEGASUS_ASSERT(key != NULL); |
_delete_func = default_delete; | _delete_func = default_delete; |
_data = new char [size]; | _data = new char [size]; |
_size = size; | _size = size; |
|
|
| |
thread_data(Sint8 *key, int size, void *data) | thread_data(Sint8 *key, int size, void *data) |
{ | { |
|
PEGASUS_ASSERT(key != NULL); |
|
PEGASUS_ASSERT(data != NULL); |
_delete_func = default_delete; | _delete_func = default_delete; |
_data = new char [size]; | _data = new char [size]; |
memcpy(_data, data, size); | memcpy(_data, data, size); |
|
|
return(old_data); | return(old_data); |
} | } |
private: | private: |
inline Boolean operator ==(void *key) ; |
inline Boolean operator ==(void *key) { if ( ! strcmp(_key, (Sint8 *)key)) return(true); return(false); } |
void (*_delete_func) (void *data) ; | void (*_delete_func) (void *data) ; |
thread_data(); | thread_data(); |
void *_data; | void *_data; |
|
|
| |
// block the calling thread until this thread terminates | // block the calling thread until this thread terminates |
void join(void ); | void join(void ); |
|
void thread_init(void); |
| |
// thread routine needs to call this function when | // thread routine needs to call this function when |
// it is ready to exit | // it is ready to exit |
|
|
DQueue<thread_data> _tsd; | DQueue<thread_data> _tsd; |
void *_thread_parm; | void *_thread_parm; |
PEGASUS_THREAD_RETURN _exit_code; | PEGASUS_THREAD_RETURN _exit_code; |
|
static Boolean _signals_blocked; |
} ; | } ; |
| |
| |