(file) Return to Thread.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/Thread.cpp between version 1.91 and 1.96

version 1.91, 2006/08/09 21:12:42 version 1.96, 2006/08/24 21:28:13
Line 29 
Line 29 
 // //
 //============================================================================== //==============================================================================
 // //
 // Author: Mike Day (mdday@us.ibm.com)  
 //  
 // Modified By: Rudy Schuet (rudy.schuet@compaq.com) 11/12/01  
 //              added nsk platform support  
 //              Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)  
 //              Amit K Arora, IBM (amita@in.ibm.com) for PEP#101  
 //              Sean Keenan, Hewlett-Packard Company (sean.keenan@hp.com)  
 //              David Dillard, VERITAS Software Corp.  
 //                  (david.dillard@veritas.com)  
 //  
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
 #include "Thread.h" #include "Thread.h"
   #include <errno.h>
 #include <exception> #include <exception>
 #include <Pegasus/Common/Tracer.h> #include <Pegasus/Common/Tracer.h>
 #include "Time.h" #include "Time.h"
Line 77 
Line 68 
 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()
Line 109 
Line 100 
 #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
  
Line 125 
Line 116 
  
 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);
 } }
Line 147 
Line 138 
 { {
     _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
 } }
  
Line 169 
Line 160 
     // are no insufficient memory.  Hence we are checking for both.  See bug     // are no insufficient memory.  Hence we are checking for both.  See bug
     // 386.     // 386.
  
       if (rc == -1)
           rc = errno;
     if ((rc == EAGAIN) || (rc == ENOMEM))     if ((rc == EAGAIN) || (rc == ENOMEM))
     {     {
         Threads::clear(_handle.thid);         Threads::clear(_handle.thid);
Line 207 
Line 200 
 //     sigaddset(sig, SIGUSR1); //     sigaddset(sig, SIGUSR1);
 //     sigaddset(sig, SIGUSR2); //     sigaddset(sig, SIGUSR2);
 // #endif // #endif
 #ifndef PEGASUS_PLATFORM_ZOS_ZSERIES_IBM  #if defined (PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) || defined (PEGASUS_OS_VMS)
     pthread_sigmask(SIG_BLOCK, sig, NULL);  
 #else  
     sigprocmask(SIG_BLOCK, sig, NULL);     sigprocmask(SIG_BLOCK, sig, NULL);
   #else
       pthread_sigmask(SIG_BLOCK, sig, NULL);
 #endif #endif
     return sig;     return sig;
 } }
Line 259 
Line 252 
     tt.handle = (HANDLE) _beginthreadex(NULL, 0, _start, this, 0, &threadid);     tt.handle = (HANDLE) _beginthreadex(NULL, 0, _start, this, 0, &threadid);
     _handle.thid = tt;     _handle.thid = tt;
  
     if (Threads::id(_handle.thid) == 0)      if (Threads::null(_handle.thid))
     {     {
         if (errno == EAGAIN)         if (errno == EAGAIN)
         {         {
Line 303 
Line 296 
  
 void Thread::join(void) void Thread::join(void)
 { {
     if (Threads::id(_handle.thid) != 0)      if (!Threads::null(_handle.thid))
     {     {
         if (!_is_detached)         if (!_is_detached)
         {         {


Legend:
Removed from v.1.91  
changed lines
  Added in v.1.96

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2