diff options
| author | bors <bors@rust-lang.org> | 2013-11-14 11:51:25 -0800 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-11-14 11:51:25 -0800 |
| commit | 0d11935bf6ae3e784aefb1c359a70fea5dfd3d00 (patch) | |
| tree | 6b4dd24f9c57a550f059e3f9d058ac9be7f9286f /src/rt/rust_builtin.cpp | |
| parent | 11ece44f02fdedb79a51b8100d36c84ee4c9408f (diff) | |
| parent | 91de538c9802e7c45cadc5391450631c74f593d2 (diff) | |
| download | rust-0d11935bf6ae3e784aefb1c359a70fea5dfd3d00.tar.gz rust-0d11935bf6ae3e784aefb1c359a70fea5dfd3d00.zip | |
auto merge of #10428 : toffaletti/rust/try_lock, r=alexcrichton
I need try_lock for an algorithm I'm trying to implement in Rust.
Diffstat (limited to 'src/rt/rust_builtin.cpp')
| -rw-r--r-- | src/rt/rust_builtin.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index 90042491d1d..4c1c6a7202a 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -394,6 +394,11 @@ rust_lock_little_lock(lock_and_signal *lock) { lock->lock(); } +extern "C" bool +rust_trylock_little_lock(lock_and_signal *lock) { + return lock->try_lock(); +} + extern "C" void rust_unlock_little_lock(lock_and_signal *lock) { lock->unlock(); |
