Re: [AD] timer_mutex again

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


Eric Botcazou wrote:

Ah, cheers!  Attached is a patch for dialog_message() instead, with a
verbose explanation.

The only potential nasty side-effect I can think of is that dialog_message() will acquire/release the screen for every object. But given that scare_mouse() is also invoked for every object, that may go unnoticed in practice.

Ok, good.

After remove_int(my_callback), my_callback is guaranteed not be in the timer queue anymore (unless install_int, but that's #1). The problem is that my_callback can have been fired but has not completed yet; context switch; the main thread returns from remove_int and set my_pointer to 0; context switch; the callback dereferences my_pointer. Ergo remove_int must wait for all callbacks to have completed before returning.

Thanks, I'll add that. But this is not something that could happen with the existing code, is it? If so, I'm stumped seeing how it could arise.

Peter




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