]> git.lizzy.rs Git - rust.git/commitdiff
Add shims for RwLock::try_read/RwLock::try_write
authorDavid Cook <divergentdave@gmail.com>
Sun, 26 Jan 2020 20:25:09 +0000 (14:25 -0600)
committerDavid Cook <divergentdave@gmail.com>
Sun, 5 Apr 2020 14:25:21 +0000 (09:25 -0500)
src/shims/foreign_items/posix.rs
tests/run-pass/sync.rs

index c9fd59c693271d94be8a5832738017e5de4fd960..4be63804a45b7dbea122845b5ec17a882aa4ac0f 100644 (file)
@@ -271,8 +271,10 @@ fn emulate_foreign_item_by_name(
             | "pthread_mutex_unlock"
             | "pthread_mutex_destroy"
             | "pthread_rwlock_rdlock"
+            | "pthread_rwlock_tryrdlock"
             | "pthread_rwlock_unlock"
             | "pthread_rwlock_wrlock"
+            | "pthread_rwlock_trywrlock"
             | "pthread_rwlock_destroy"
             | "pthread_condattr_init"
             | "pthread_condattr_setclock"
index 54d79566eae4bceabd93330f520db22e45c1fd2c..14243349f967115cc08c139bbbd458ffaffebe8f 100644 (file)
@@ -12,7 +12,9 @@ fn main() {
     {
         let rw = sync::RwLock::new(0);
         drop(rw.read());
+        drop(rw.try_read());
         drop(rw.write());
+        drop(rw.try_write());
         drop(rw);
     }
 }