Re: [AD] public thread API |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On 2008-08-06, Elias Pschernig <elias@xxxxxxxxxx> wrote:
> On Wed, 2008-08-06 at 11:04 +1000, Peter Wang wrote:
> >
> > As in, al_create_thread, al_lock_mutex, al_broadcast_cond. Which looks
> > fine actually. We should do it for consistency.
> >
>
> Oh, something else:
>
> int al_cond_timedwait(ALLEGRO_COND *cond, ALLEGRO_MUTEX *mutex,
> const ALLEGRO_COND_TIMEOUT timeout);
>
> What about using "double timeout", and specifying it in seconds?
This reminds me of a similar decision in the events API that we
discussed, which I forgot to implement. We should adopt the same
solution for al_cond_timedwait as for the events function.
At any rate, it should be an absolute timeout as al_cond_timedwait()
*needs* to be called in a loop. With relative timeouts you're
obliged to keep track of how long al_cond_timedwait() took
and subtract that for the next iteration of the loop.
Peter