Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8763/src
Modified Files: Tag: devel_0_38 m_sched.c Log Message: fixed bug with idle-callbacks... fetch next one from the fifo in any case.
Index: m_sched.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/m_sched.c,v retrieving revision 1.5.4.13 retrieving revision 1.5.4.14 diff -C2 -d -r1.5.4.13 -r1.5.4.14 *** m_sched.c 11 Jan 2005 21:41:14 -0000 1.5.4.13 --- m_sched.c 15 Jan 2005 22:56:25 -0000 1.5.4.14 *************** *** 655,658 **** --- 655,659 ---- if (idle_callback != NULL) { + double remain; double stop = sys_getrealtime() + sys_sleepgrain; do *************** *** 662,669 **** freebytes (idle_callback->argv, idle_callback->argc); freebytes ((void*)idle_callback, sizeof(t_sched_callback)); - idle_callback = fifo_get(callback_fifo); } } ! while ( (sys_getrealtime() > stop) && (idle_callback != NULL)); return 0; } --- 663,675 ---- freebytes (idle_callback->argv, idle_callback->argc); freebytes ((void*)idle_callback, sizeof(t_sched_callback)); } + idle_callback = fifo_get(callback_fifo); + + remain = stop-sys_getrealtime(); } ! while ((remain > 0) && (idle_callback != NULL)); ! ! /* sleep for the rest of the time */ ! // if(remain > 0) sys_microsleep(remain); return 0; }