version 1.6, 2006/11/10 18:14:58
|
version 1.10.6.1, 2008/07/17 19:46:18
|
|
|
#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 |
| |
|
|
{ | { |
#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) |
{ | { |
|
|
// 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 |
} | } |
| |
|
|
| |
// 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; |