Re: [AD] Mini-synchronization API proposal for 4.1.x

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


On 2002-03-21, Eric Botcazou <ebotcazou@xxxxxxxxxx> wrote:
> I've attached a patch for the high-level implementation (mutex.diff), as
> well as a patch for the Win32 implementation (win_mutex.diff).
...
> +void al_unlock_mutex(AL_MUTEX *mutex)
> +{
> +   ASSERT(system_driver);
> +
> +   if (system_driver->unlock_mutex)
> +      system_driver->unlock_mutex(mutex->handle);
> +
> +   mutex->locked = FALSE;
> +}

This is wrong, e.g.

thread A	thread B
--------	--------
unlock_mutex
                lock_mutex
                locked = TRUE
locked = FALSE

Also a similar problem in at least `al_destroy_mutex'.  IMHO `locked'
is unnecessary anyway.



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