Re: PSA: Clock drift and pkgin

Robert Elz <[email protected]>
Newsgroups gmane.os.netbsd.devel.kernel
Message-ID <[email protected]>
    Date:        Sun, 24 Dec 2023 13:49:53 +0100
    From:        Johnny Billquist <[email protected]>
    Message-ID:  <[email protected]>

  | In my opinion, all of these POSIX calls that take a time argument should 
  | really have been done the same as clock_gettime(), in that you specify 
  | what clock it should be based on.

The next version of POSIX will contain pthread_cond_clockwait() which is
just like pthread_cond_timedwait() but has a clock_id parameter.

  | As it is now, it is (or should be according to POSIX) unconditionally 
  | CLOCK_REALTIME.

Not sure about the current released standard, and too lazy to look ...
but in the coming one that's not true either:

	The pthread_cond_timedwait() function shall be equivalent to
	pthread_cond_clockwait(), except that it lacks the clock_id argument.
	The clock to measure abstime against shall instead come from the
	condition variable's clock attribute which can be set by
	pthread_condattr_setclock() prior to the condition variable's
	creation. If no clock attribute has been set, the default shall be
	CLOCK_REALTIME.

kre
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.