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

Diff for /pegasus/src/Pegasus/Common/Threads.cpp between version 1.6 and 1.10.6.1

version 1.6, 2006/11/10 18:14:58 version 1.10.6.1, 2008/07/17 19:46:18
Line 37 
Line 37 
 #include "TSDKey.h" #include "TSDKey.h"
 #include "Once.h" #include "Once.h"
  
 #if defined(PEGASUS_PLATFORM_WIN32_IX86_MSVC)  #if defined(PEGASUS_OS_TYPE_WINDOWS)
 # include <sys/timeb.h> # include <sys/timeb.h>
 #endif #endif
  
Line 47 
Line 47 
 { {
 #if defined(PEGASUS_HAVE_NANOSLEEP) #if defined(PEGASUS_HAVE_NANOSLEEP)
  
     struct timespec wait;      struct timespec wait, remwait;
     wait.tv_sec = msec / 1000;     wait.tv_sec = msec / 1000;
     wait.tv_nsec = (msec % 1000) * 1000000;     wait.tv_nsec = (msec % 1000) * 1000000;
     nanosleep(&wait, NULL);  
  
 #elif defined(PEGASUS_PLATFORM_OS400_ISERIES_IBM)      while ((nanosleep(&wait, &remwait) == -1) && (errno == EINTR))
   
    int loop;  
    int microsecs = msec * 1000; /* convert from milliseconds to microseconds */  
   
    if (microsecs < 1000000)  
        usleep(microsecs);  
    else  
    {    {
        loop = microsecs / 1000000;          wait.tv_sec = remwait.tv_sec;
        for (int i = 0; i < loop; i++)          wait.tv_nsec = remwait.tv_nsec;
            usleep(1000000);  
        if ((loop*1000000) < microsecs)  
            usleep(microsecs - (loop*1000000));  
    }    }
  
 #elif defined(PEGASUS_PLATFORM_WIN32_IX86_MSVC)  #elif defined(PEGASUS_OS_TYPE_WINDOWS)
  
     if (msec == 0)     if (msec == 0)
     {     {
Line 102 
Line 91 
         // Usleep the remaining micro seconds         // Usleep the remaining micro seconds
         usleep( (msec*1000) % 1000000 );         usleep( (msec*1000) % 1000000 );
     }     }
 #elif defined(PEGASUS_OS_VMS)  
   
     ::sleep(msec / 1000);  
   
 #endif #endif
 } }
  
Line 216 
Line 201 
  
     // Detached:     // Detached:
  
     if (type == DETACHED)      if (type == THREADS_DETACHED)
     {     {
 #if defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM) #if defined(PEGASUS_PLATFORM_ZOS_ZSERIES_IBM)
         int ds = 1;         int ds = 1;


Legend:
Removed from v.1.6  
changed lines
  Added in v.1.10.6.1

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2