about summary refs log tree commit diff
path: root/src/rt/rust_builtin.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-10-25 00:46:11 -0700
committerbors <bors@rust-lang.org>2013-10-25 00:46:11 -0700
commitdeeca5d586bfaa4aa60246f671a8d611d38f6248 (patch)
treea0aaa22d41ef38f3ef93ab72e399860edd31ff25 /src/rt/rust_builtin.cpp
parentac82d185b0a9d04bb4e85578aad558da784a2be4 (diff)
parent64a5c3bc1ee869990f8205374f9dac837a475dbd (diff)
downloadrust-deeca5d586bfaa4aa60246f671a8d611d38f6248.tar.gz
rust-deeca5d586bfaa4aa60246f671a8d611d38f6248.zip
auto merge of #10054 : alexcrichton/rust/basic-event-loop, r=brson
This is more progress towards #9128 and all its related tree of issues. This implements a new `BasicLoop` on top of pthreads synchronization primitives (wrapped in `LittleLock`). This also removes the wonky `callback_ms` function from the interface of the event loop.

After #9901 is taking forever to land, I'm going to try to do all this runtime work in much smaller chunks than before. Right now this will not work unless #9901 lands first, but I'm close to landing it (hopefully), and I wanted to go ahead and get this reviewed before throwing it at bors later on down the road.

This "pausible idle callback" is also a bit of a weird idea, but it wasn't as difficult to implement as callback_ms so I'm more semi-ok with it.
Diffstat (limited to 'src/rt/rust_builtin.cpp')
-rw-r--r--src/rt/rust_builtin.cpp10
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 {