Skip to content

Commit 1bdcd36

Browse files
committed
fix clock.sync(div) could cause excess events with fractional values
1 parent 16cbc91 commit 1bdcd36

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/clock.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ bool clock_schedule_resume_sync( int coro_id, float beats ){
108108
awaken += dbeats;
109109

110110
// check we haven't already passed it in the sub-beat & add another step if we have
111-
if(awaken <= precise_beat_now){
111+
// we have to loop because fractional beats values may occur >2 times within a beat
112+
while(awaken <= precise_beat_now){
112113
awaken += dbeats;
113114
}
114115

0 commit comments

Comments
 (0)