Re: [AD] (still) a race condition in mixer.c

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 2003-06-30, Eric <ebotcazou@xxxxxxxxxx> wrote:
> > Instead of patching mixer.c, what about creating wrappers (in a
> > platform-specific file, say src/unix/upmixer.c) around the relevant
> > _mixer_* functions which do the synchronisation as required, then making
> > uoss.c, etc. refer to the wrappers if the pthreads are used?
> 
> I guess that if there is a race condition on Linux, there is probably the 
> same race condition on any multitasking OSes. So why not use the dormant 
> synchronization API (i.e re-enable ALLEGRO_MULTITHREADED in the various 
> configuration files and convert Sam's code to use this API)?

Oh, I forgot all about it, since I thought you reverted it.  Yes, your
suggestion is better.

> Are you sure that this synchronization won't open the same can of worms that 
> the timer synchronization did?

Sam's only change was to synchronise _mix_some_samples() and
_mixer_release_voice(), which should not have such a big impact.. I think.
I guess other race conditions will crop up in future, though.

-- 
王浩禎




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/