From d1857d30fc05f29fb82231336b229e50948a8336 Mon Sep 17 00:00:00 2001 From: Eric Holk Date: Tue, 31 May 2011 17:44:54 -0700 Subject: This is the mega-ucontext commit. It replaces the task switching mechanism with a new one inspired by ucontext. It works under Linux, OS X and Windows, and is Valgrind clean on Linux and OS X (provided the runtime is built with gcc). This commit also moves yield and join to the standard library, as requested in #42. Join is currently a no-op though. --- src/rt/rust_builtin.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/rt/rust_builtin.cpp') diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index f4b2639b137..65c9d7e76a1 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -354,6 +354,16 @@ task_sleep(rust_task *task, size_t time_in_us) { upcall_sleep(task, time_in_us); } +extern "C" CDECL void +task_yield(rust_task *task) { + task->yield(1); +} + +extern "C" CDECL void +task_join(rust_task *task, rust_task *join_task) { + // TODO +} + /* Debug builtins for std.dbg. */ static void -- cgit 1.4.1-3-g733a5