[PATCH] clock_nanosleep(2), pthread_condattr_[gs]etclock(3)
Corinna Vinschen
corinna-cygwin@cygwin.com
Thu Jul 21 07:54:00 GMT 2011
On Jul 20 17:03, Yaakov (Cygwin/X) wrote:
> On Wed, 2011-07-20 at 16:11 +0200, Corinna Vinschen wrote:
> > (*) Does it also influence pthread_cond_timedwait? This information seems
> > to be missing in SUSv4.
>
> The last paragraph of RATIONALE -> Timed Wait Semantics states:
>
> > For cases when the system clock is advanced discontinuously by an
> > operator, it is expected that implementations process any timed wait
> > expiring at an intervening time as if that time had actually occurred.
>
> Of course, this would be an old problem with pthread_cond_timedwait().
Thanks, I missed that.
> 2011-07-20 Yaakov Selkowitz <yselkowitz@...>
>
> * sysconf.cc (sca): Set _SC_CLOCK_SELECTION to _POSIX_CLOCK_SELECTION.
>
> 2011-07-20 Yaakov Selkowitz <yselkowitz@...>
>
> * cygwin.din (pthread_condattr_getclock): Export.
> (pthread_condattr_setclock): Export.
> * posix.sgml (std-notimpl): Move pthread_condattr_getclock and
> pthread_condattr_setclock from here...
> (std-susv4): ... to here.
> * thread.cc: (pthread_condattr::pthread_condattr): Initialize clock_id.
> (pthread_cond::pthread_cond): Initialize clock_id.
> (pthread_cond_timedwait): Use clock_gettime() instead of gettimeofday()
> in order to support all allowed clocks.
> (pthread_condattr_getclock): New function.
> (pthread_condattr_setclock): New function.
> * thread.h (class pthread_condattr): Add clock_id member.
> (class pthread_cond): Ditto.
> * include/pthread.h: Remove obsolete comment.
> (pthread_condattr_getclock): Declare.
> (pthread_condattr_setclock): Declare.
This patch looks good, please apply.
Thanks,
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat
More information about the Cygwin-patches
mailing list