(file) Return to ThreadUnix_inline.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common / Attic

Diff for /pegasus/src/Pegasus/Common/Attic/ThreadUnix_inline.h between version 1.20 and 1.21

version 1.20, 2005/06/22 20:34:44 version 1.21, 2005/06/24 19:34:23
Line 52 
Line 52 
  
 extern "C" { void * _linkage(void * zosParm); } extern "C" { void * _linkage(void * zosParm); }
  
 inline Boolean Thread::run()  inline ThreadStatus Thread::run()
 { {
     zosParmDef * zosParm = (zosParmDef *)malloc(sizeof(zosParmDef));     zosParmDef * zosParm = (zosParmDef *)malloc(sizeof(zosParmDef));
     zosParm->_start = _start;     zosParm->_start = _start;
Line 66 
Line 66 
     int rc;     int rc;
     rc = pthread_create((pthread_t *)&_handle.thid,     rc = pthread_create((pthread_t *)&_handle.thid,
                         &_handle.thatt, &_linkage, zosParm);                         &_handle.thatt, &_linkage, zosParm);
     if (rc == EAGAIN)     /* On Sun Solaris, the manpage states that 'ENOMEM' is the error
         code returned when there is no insufficient memory, but the
         POSIX standard mentions EAGAIN as the proper return code, so
         we checking for both. */
       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)          // The error code can be retrieved from  'errno'.
         _handle.thid = 0;         _handle.thid = 0;
         return true;          return PEGASUS_THREAD_SETUP_FAILURE;
     }     }
     return true;      return PEGASUS_THREAD_OK;
 } }
 #else // PEGASUS_PLATFORM_SOLARIS_SPARC_CC #else // PEGASUS_PLATFORM_SOLARIS_SPARC_CC
 inline Boolean Thread::run()  inline ThreadStatus Thread::run()
 { {
     if (_is_detached)     if (_is_detached)
     {     {
Line 95 
Line 99 
     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 Linux distributions released prior 2005, the
         implementation of Native POSIX Thread Library
         returns ENOMEM instead of EAGAIN when there are no
         insufficient memory.  Hence we are checking for both.
   
         More details can be found : http://sources.redhat.com/bugzilla/show_bug.cgi?id=386
       */
       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;
 } }
 #endif // PEGASUS_PLATFORM_SOLARIS_SPARC_CC #endif // PEGASUS_PLATFORM_SOLARIS_SPARC_CC
  


Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2