Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17773
Modified Files: Tag: devel_0_39 m_sched.c Log Message: even more stable locking
Index: m_sched.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/m_sched.c,v retrieving revision 1.5.4.35.2.19 retrieving revision 1.5.4.35.2.20 diff -C2 -d -r1.5.4.35.2.19 -r1.5.4.35.2.20 *** m_sched.c 30 Jun 2006 11:45:18 -0000 1.5.4.35.2.19 --- m_sched.c 30 Jun 2006 15:31:53 -0000 1.5.4.35.2.20 *************** *** 779,784 **** double stop;
- sys_unlock(); - stop = sys_getrealtime()*1.e6 + (double)microsec;
--- 779,782 ---- *************** *** 805,810 **** if (ringbuffer_head != NULL) { - sys_lock(); - double remain = stop - sys_getrealtime() * 1.e6; t_sched_callback * idle_callback = ringbuffer_head; --- 803,806 ---- *************** *** 845,850 **** }
- sys_unlock(); - remain = stop-sys_getrealtime()*1.e6; } --- 841,844 ---- *************** *** 852,860 ****
/* sleep for the rest of the time */ ! if(remain > 0) sys_microsleep(remain); } ! else sys_microsleep(microsec); } /* } tb */ --- 846,860 ----
/* sleep for the rest of the time */ ! if(remain > 0) { ! sys_unlock(); sys_microsleep(remain); + sys_lock(); + } } ! else { ! sys_unlock(); sys_microsleep(microsec); + sys_lock(); + } } /* } tb */