diff options
author | David Carlier <devnexen@gmail.com> | 2022-03-30 18:05:23 +0000 |
---|---|---|
committer | David Carlier <devnexen@gmail.com> | 2022-03-30 18:05:23 +0000 |
commit | ed0b1b93b695a267635649372fcaddef336dcf62 (patch) | |
tree | 288a9c7bc2890d4271b280c6a0e7a40664f98508 | |
parent | 9d1d40a966ba79feabaf3418edb5089bee5e5d37 (diff) | |
download | rust-libc-ed0b1b93b695a267635649372fcaddef336dcf62.tar.gz |
haiku add pthread spinlock api
-rw-r--r-- | src/unix/haiku/mod.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/unix/haiku/mod.rs b/src/unix/haiku/mod.rs index d0a835bc1f..4ddda212aa 100644 --- a/src/unix/haiku/mod.rs +++ b/src/unix/haiku/mod.rs @@ -285,6 +285,10 @@ s! { waiters: [*mut ::c_void; 2], } + pub struct pthread_spinlock_t { + lock: u32, + } + pub struct passwd { pub pw_name: *mut ::c_char, pub pw_passwd: *mut ::c_char, @@ -1612,6 +1616,11 @@ extern "C" { lock: *mut pthread_mutex_t, abstime: *const ::timespec, ) -> ::c_int; + pub fn pthread_spin_init(lock: *mut ::pthread_spinlock_t, pshared: ::c_int) -> ::c_int; + pub fn pthread_spin_destroy(lock: *mut ::pthread_spinlock_t) -> ::c_int; + pub fn pthread_spin_lock(lock: *mut ::pthread_spinlock_t) -> ::c_int; + pub fn pthread_spin_trylock(lock: *mut ::pthread_spinlock_t) -> ::c_int; + pub fn pthread_spin_unlock(lock: *mut ::pthread_spinlock_t) -> ::c_int; pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int) -> ::c_int; |