Date: Tue, 9 May 2006 20:51:32 GMT From: John Birrell <jb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 96875 for review Message-ID: <200605092051.k49KpWi1086714@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=96875 Change 96875 by jb@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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200605092051.k49KpWi1086714>