Re: [AD] Strange timer behavior in 5.2.1.1

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


Thanks for reporting this. Looks like I messed this up. I think this patch will fix it:

 

diff --git a/src/timernu.c b/src/timernu.c

index 9179969..66f1c33 100644

--- a/src/timernu.c

+++ b/src/timernu.c

@@ -104,6 +104,7 @@ static void timer_thread_proc(_AL_THREAD *self, void *unused)

       al_lock_mutex(timers_mutex);

       while (_al_vector_size(&active_timers) == 0 && !destroy_thread) {

          al_wait_cond(timer_cond, timers_mutex);

+         old_time = al_get_time();

       }

       al_unlock_mutex(timers_mutex);

 

 

Can you try this in the PacMan game? Ex_timer_pause won’t work unless you build it as a console app (the examples are now built as Windows applications), but I confirmed it works on Linux.

 

 

 

From: Edgar Reynaldo
Sent: August 21, 2016 2:10 PM
To: Allegro Developers
Subject: [AD] Strange timer behavior in 5.2.1.1

 

Hi guys.

 

I made some binaries for Allegro 5.2.1.1 using MinGW 5.3.0 and Neil Roy

used them to recompile his Pacman game and he noticed some very bizarre

behavior that is associated with Allegro timers.

 

It is detailed here :

https://www.allegro.cc/forums/thread/616446/1024510#target

 

Additionally, ex_timer_pause behaves strangely, detailed here :

https://www.allegro.cc/forums/thread/616446/1024512#target

 

There were some changes introduced in Allegro 5.2.0 which altered timer

behavior. According to the changelog, it says :

 

"Don't stop and join the timer thread when stopping the last timer

(prevents unnecessary delay in this situation on some platforms)."

 

Neil stops the timers in his game when waiting for a keypress. I suspect

the change in 5.2.0 is affecting this. The timers in his game don't

appear to be stopping, rather, the timer events seem to be piling up

while the timers are stopped.

 

As for ex_timer_pause, I'm not sure what's going on. It's very strange

that none of the printf output gets shown in any test run of the program.

 

Edgar

 

 

 

_______________________________________________

Allegro-developers mailing list

Allegro-developers@xxxxxxxxxx

https://mail.gna.org/listinfo/allegro-developers

 



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