PERFORCE change 96875 for review
John Birrell
jb at FreeBSD.org
Tue May 9 20:51:33 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=96875
Change 96875 by jb at jb_freebsd2 on 2006/05/09 20:51:20
Convert from 'uptime' times to 'real' times so that the timed wait
does a sensible thing... like wait until the time we expected.
Affected files ...
.. //depot/projects/dtrace/src/contrib/opensolaris/lib/libdtrace/common/dt_work.c#8 edit
Differences ...
==== //depot/projects/dtrace/src/contrib/opensolaris/lib/libdtrace/common/dt_work.c#8 (text) ====
@@ -75,7 +75,6 @@
(void) pthread_mutex_lock(&dph->dph_lock);
-#if defined(sun)
now = gethrtime();
if (earliest < now) {
@@ -83,6 +82,7 @@
return; /* sleep duration has already past */
}
+#if defined(sun)
tv.tv_sec = (earliest - now) / NANOSEC;
tv.tv_nsec = (earliest - now) % NANOSEC;
@@ -93,6 +93,7 @@
*/
(void) pthread_cond_reltimedwait_np(&dph->dph_cv, &dph->dph_lock, &tv);
#else
+ earliest -= now;
clock_gettime(CLOCK_REALTIME,&tv);
tv.tv_sec += earliest / NANOSEC;
tv.tv_nsec += earliest % NANOSEC;
More information about the p4-projects
mailing list