tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pthread_cond_timedwait() returns ESRCH



On Thu, 17 Mar 2011 17:02:46 +0000
Sad Clouds <cryintothebluesky%googlemail.com@localhost> wrote:

> Hi, I'm trying to figure out why pthread_cond_timedwait() sometimes
> returns error code 3 (ESRCH). Anyone knows under what circumstances
> this can happen?

OK I think I know what might be causing this. I was taking current time
snapshot with clock_gettime(CLOCK_MONOTONIC, &ts) and I think NetBSD
pthreads implementation wants CLOCK_REALTIME. There appears to be no
pthread_condattr_setclock() function, so CLOCK_REALTIME is probably the
only option.

It might be useful to add this info to pthread_cond_timedwait man page,
as it's very easy to mix up the clock types.


Home | Main Index | Thread Index | Old Index