[MPlayer-dev-eng] threaded cache

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Nov 27 16:12:00 CET 2011


On Sat, Nov 26, 2011 at 07:41:00PM +0100, Dan Oscarsson wrote:
> +#if defined(PTHREAD_CACHE)
> +            pthread_mutex_lock(&s->go_ahead_mutex);
> +            clock_gettime(CLOCK_REALTIME, &ts);
> +            ts.tv_nsec += sleep_time*1000;
> +            pthread_cond_timedwait(&s->go_ahead, &s->go_ahead_mutex, &ts);

Operating systems do not have to provide (and some, including older
Linux do not) provide a monotonous clock.
I very strongly dislike usage of such inherently unportable stuff
(I blame pthreads for relying on absolute timeouts (which is reasonable)
without providing for a time source).


More information about the MPlayer-dev-eng mailing list