Hi folks,

While I'm waiting for something at $WORK to compile, I thought I'd
take a crack at easy issue #42, moving yield and join into the
standard library.

After removing the yield and join keywords from the front/middle ends,
is it enough to just add this to std._task:

 native "rust" mod rustrt {
     fn task_sleep(uint time_in_us);
+    fn upcall_join(task t);
+    fn upcall_yield();
 }

+fn join(task t) {
+    ret rustrt.upcall_join(t);
+}
+
+fn yield() {
+    ret rustrt.upcall_yield();
+}

join() seems to work; I don't know how to test yield().

I see that nothing else in the stdlib calls an upcall_ function; is
this bad form? Should I add task_yield and task_join to
rust_builtin.cpp instead, the way task_sleep is handled?

Best,
Graham
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to