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/rust_builtin.cpp | |
| 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/rust_builtin.cpp')
| -rw-r--r-- | src/rt/rust_builtin.cpp | 10 |
1 files changed, 10 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 { |
