[MPlayer-dev-eng] threaded cache
Reimar Döffinger
Reimar.Doeffinger at gmx.de
Sun Nov 27 16:15:20 CET 2011
On Sun, Nov 27, 2011 at 04:12:00PM +0100, Reimar Döffinger wrote:
> 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).
Ha, they actually did think of that:
pthread_get_expiration_np
Except for "Note: This function is not portable." *facepalm* WTF is the
point of it then? Hey, we saw there's a portability issue with our API.
Let's add a non-portable API to solve it!
More information about the MPlayer-dev-eng
mailing list