Re: [AD] minor fix

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


On Tue, 2004-07-06 at 14:10 +1000, Peter Wang wrote:
> >Hmm... yes, I have the same problem with expal... I have a feeling it's an 
> >issue with the palette fades though, since I've never seen the problem in 
> >my own code.
> >  
> >
> 
> Yes, for expal that is the case.  The palette fades really "saturate" 
> the X event thread.  If you put in something to break up the palette 
> fades, e.g. yield_timeslice() or rest(1), then it responds much faster.
> 

Interestingly, setting the delay in line 102 of unix/uthreads.c to 1
(instead of 10000) makes the delay go away. But I'm not sure if this
change is safe, even though it is the same effect used by my
yield_timeslice change.

Btw, reading through uthread.c, I came up with the attached patch,
hopefully saving a lot of confusion to the next person reading it (not
that I'm not still uncertain what 'interval' is for). This superfluous
line also makes me think that whoever wrote the original function and
put the 10000 in there wasn't too sure what is going on :)

-- 
Elias Pschernig
Index: src/unix/uthreads.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/unix/uthreads.c,v
retrieving revision 1.16
diff -u -p -r1.16 uthreads.c
--- src/unix/uthreads.c	1 Oct 2003 16:15:23 -0000	1.16
+++ src/unix/uthreads.c	7 Jul 2004 10:51:13 -0000
@@ -81,7 +81,6 @@ static void *bg_man_pthreads_threadfunc(
       while (interval) {
 	 i = MIN (interval, INT_MAX/(TIMERS_PER_SECOND/100));
 	 interval -= i;
-	 i = i * (TIMERS_PER_SECOND/100) / 10000L;
 
 	 pthread_mutex_lock(&cli_mutex);
 


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