Revision: 29491
http://sourceforge.net/p/opalvoip/code/29491
Author: rjongbloed
Date: 2013-04-12 01:26:21 +0000 (Fri, 12 Apr 2013)
Log Message:
-----------
Fixed Unix vesion of PTrace::Sleep() when sleeping for more than one second.
Modified Paths:
--------------
ptlib/trunk/src/ptlib/unix/tlibthrd.cxx
Modified: ptlib/trunk/src/ptlib/unix/tlibthrd.cxx
===================================================================
--- ptlib/trunk/src/ptlib/unix/tlibthrd.cxx 2013-04-11 06:43:34 UTC (rev 29490)
+++ ptlib/trunk/src/ptlib/unix/tlibthrd.cxx 2013-04-12 01:26:21 UTC (rev 29491)
@@ -709,9 +709,9 @@
{
struct timespec ts;
ts.tv_sec = timeout.GetSeconds();
- ts.tv_nsec = timeout.GetMilliSeconds()*1000000;
+ ts.tv_nsec = (timeout.GetMilliSeconds()%1000)*1000000;
- while (nanosleep(&ts, &ts) < 0 && errno == EINTR) {
+ while (nanosleep(&ts, &ts) < 0 && PAssert(errno == EINTR || errno == EAGAIN, POperatingSystemError)) {
#if P_USE_THREAD_CANCEL
pthread_testcancel();
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|