diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-10-22 15:00:37 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-10-24 23:49:11 -0700 |
| commit | 64a5c3bc1ee869990f8205374f9dac837a475dbd (patch) | |
| tree | e791509c56fd43d8a5055e4d9ca163897ed4c4b5 /src/rt | |
| parent | 3ee5ef12fb71be95d6e7f679900a497a2580d25e (diff) | |
| download | rust-64a5c3bc1ee869990f8205374f9dac837a475dbd.tar.gz rust-64a5c3bc1ee869990f8205374f9dac837a475dbd.zip | |
Implement a basic event loop built on LittleLock
It's not guaranteed that there will always be an event loop to run, and this implementation will serve as an incredibly basic one which does not provide any I/O, but allows the scheduler to still run. cc #9128
Diffstat (limited to 'src/rt')
| -rw-r--r-- | src/rt/rust_builtin.cpp | 10 | ||||
| -rw-r--r-- | src/rt/rustrt.def.in | 2 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index 77020537661..a8eec52943e 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -377,6 +377,16 @@ rust_unlock_little_lock(lock_and_signal *lock) { lock->unlock(); } +extern "C" void +rust_wait_little_lock(lock_and_signal *lock) { + lock->wait(); +} + +extern "C" void +rust_signal_little_lock(lock_and_signal *lock) { + lock->signal(); +} + typedef void(startfn)(void*, void*); class raw_thread: public rust_thread { diff --git a/src/rt/rustrt.def.in b/src/rt/rustrt.def.in index 269da8e7882..06f4c0006f1 100644 --- a/src/rt/rustrt.def.in +++ b/src/rt/rustrt.def.in @@ -128,6 +128,8 @@ rust_create_little_lock rust_destroy_little_lock rust_lock_little_lock rust_unlock_little_lock +rust_signal_little_lock +rust_wait_little_lock tdefl_compress_mem_to_heap tinfl_decompress_mem_to_heap rust_uv_ip4_port |
