diff options
| author | Dirkjan Bussink <d.bussink@gmail.com> | 2013-11-05 14:13:02 +0100 |
|---|---|---|
| committer | Dirkjan Bussink <d.bussink@gmail.com> | 2013-11-05 17:49:46 +0100 |
| commit | 47e0bd403a04d26506f723ac44ee9ea0aa5d3ad5 (patch) | |
| tree | 5471652a73737a511636093172321b7d1dc06130 /src/rt/rust_builtin.cpp | |
| parent | 92065ceb634872f53a1a402cf306fbf02550b00d (diff) | |
| download | rust-47e0bd403a04d26506f723ac44ee9ea0aa5d3ad5.tar.gz rust-47e0bd403a04d26506f723ac44ee9ea0aa5d3ad5.zip | |
Move implementation for threads to Rust
This binds to the appropriate pthreads_* and Windows specific functions and calls them from Rust. This allows for removal of the C++ support code for threads. Fixes #10162
Diffstat (limited to 'src/rt/rust_builtin.cpp')
| -rw-r--r-- | src/rt/rust_builtin.cpp | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index 90cfd98bc48..486c95a548d 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -11,7 +11,6 @@ /* Foreign builtins. */ #include "rust_util.h" -#include "sync/rust_thread.h" #include "sync/lock_and_signal.h" #include "vg/valgrind.h" @@ -385,42 +384,6 @@ rust_signal_little_lock(lock_and_signal *lock) { lock->signal(); } -typedef void(startfn)(void*, void*); - -class raw_thread: public rust_thread { -public: - startfn *raw_start; - void *rust_fn; - void *rust_env; - - raw_thread(startfn *raw_start, void *rust_fn, void *rust_env) - : raw_start(raw_start), rust_fn(rust_fn), rust_env(rust_env) { } - - virtual void run() { - raw_start(rust_fn, rust_env); - } -}; - -extern "C" raw_thread* -rust_raw_thread_start(startfn *raw_start, void *rust_start, void *rust_env) { - assert(raw_start && rust_start); - raw_thread *thread = new raw_thread(raw_start, rust_start, rust_env); - thread->start(); - return thread; -} - -extern "C" void -rust_raw_thread_join(raw_thread *thread) { - assert(thread); - thread->join(); -} - -extern "C" void -rust_raw_thread_delete(raw_thread *thread) { - assert(thread); - delete thread; -} - #ifndef _WIN32 #include <sys/types.h> #include <dirent.h> |
