version 1.2, 2005/02/18 16:12:26
|
version 1.3, 2005/06/24 19:34:23
|
|
|
#ifndef ThreadVms_inline_h | #ifndef ThreadVms_inline_h |
#define ThreadVms_inline_h | #define ThreadVms_inline_h |
| |
inline Boolean Thread::run() |
inline ThreadStatus Thread::run() |
{ | { |
if (_is_detached) | if (_is_detached) |
{ | { |
|
|
int rc; | int rc; |
rc = pthread_create((pthread_t *)&_handle.thid, | rc = pthread_create((pthread_t *)&_handle.thid, |
&_handle.thatt, _start, this); | &_handle.thatt, _start, this); |
if (rc == EAGAIN) |
|
|
/* On VMS the return code when there is inssuficient resources to create |
|
a thread is ENOMEM. The POSIX standard defines that it should be EAGAIN, |
|
hence we checking both values. |
|
|
|
For more details: |
|
http://aether.lbl.gov/htbin/helpgate/HELP/DECTHREADS/PTHREAD_ROUTINES/PTHREAD_CREATE/RETURN_VALUES |
|
*/ |
|
if ((rc == EAGAIN) || (rc==ENOMEM)) |
{ | { |
_handle.thid = 0; | _handle.thid = 0; |
return false; |
return PEGASUS_THREAD_INSUFFICIENT_RESOURCES; |
} | } |
else if (rc != 0) | else if (rc != 0) |
{ | { |
// ATTN: Error behavior has not yet been defined (see Bugzilla 972) |
|
_handle.thid = 0; | _handle.thid = 0; |
return true; |
return PEGASUS_THREAD_SETUP_FAILURE; |
} | } |
return true; |
return PEGASUS_THREAD_OK; |
} | } |
| |
| |