// 41.ck : event// declare an eventEvent e;// declare functionfun int hi( Event e ){ // wait on event e e => now; // this only happens AFTER e is signaled <<<"success">>>;}// spork shred with espork ~ hi( e );// allow time to pass to give the shred a chance to run1::ms => now;// signal ee.signal();// advance time to let the other shred run// (the parent shred will free the child shred)1::samp => now;
// 41.ck : event
// declare an event
Event e;
// declare function
fun int hi( Event e )
{
// wait on event e
e => now;
// this only happens AFTER e is signaled
<<<"success">>>;
}
// spork shred with e
spork ~ hi( e );
// allow time to pass to give the shred a chance to run
1::ms => now;
// signal e
e.signal();
// advance time to let the other shred run
// (the parent shred will free the child shred)
1::samp => now;