diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/NanoEvent.ck | 9 | ||||
-rw-r--r-- | lib/RumbleEvent.ck | 6 |
2 files changed, 14 insertions, 1 deletions
diff --git a/lib/NanoEvent.ck b/lib/NanoEvent.ck index 2bf6378..9c501aa 100644 --- a/lib/NanoEvent.ck +++ b/lib/NanoEvent.ck @@ -64,8 +64,15 @@ public class NanoEvent extends GenEvent { msg.data3/127.0 => value; if (cmd == 0xB0 && - (wantScene == "" || scene == wantScene)) + (wantScene == "" || scene == wantScene)) { broadcast(); + /* + * ensure that shreds waiting on the event + * process it before it is overwritten + * by the next message in the queue + */ + me.yield(); + } } } /* not reached */ diff --git a/lib/RumbleEvent.ck b/lib/RumbleEvent.ck index 91aed80..d96635e 100644 --- a/lib/RumbleEvent.ck +++ b/lib/RumbleEvent.ck @@ -42,6 +42,12 @@ public class RumbleEvent extends GenEvent { <= IO.newline(); } else { broadcast(); + /* + * ensure that shreds waiting on the event + * process it before it is overwritten + * by the next message in the queue + */ + me.yield(); } } } |