fixed SF# 2841812: Posix ThreadImpl::sleepImpl throws exceptions on EINTR

This commit is contained in:
Guenter Obiltschnig
2009-08-25 06:49:47 +00:00
parent 4bdeaa7baf
commit 9464ca7b24
2 changed files with 34 additions and 17 deletions

View File

@@ -180,23 +180,6 @@ inline int ThreadImpl::getOSPriorityImpl() const
}
inline void ThreadImpl::sleepImpl(long milliseconds)
{
#if defined(__VMS) || defined(__digital__)
// This is specific to DECThreads
struct timespec interval;
interval.tv_sec = milliseconds / 1000;
interval.tv_nsec = (milliseconds % 1000)*1000000;
pthread_delay_np(&interval);
#else
struct timeval tv;
tv.tv_sec = milliseconds / 1000;
tv.tv_usec = (milliseconds % 1000) * 1000;
select(0, NULL, NULL, NULL, &tv);
#endif
}
inline bool ThreadImpl::isRunningImpl() const
{
return _pData->pRunnableTarget != 0 ||