Skip to content

Commit 4297ad1

Browse files
committed
Auto merge of #2734 - devnexen:pthread_spin_haiku, r=Amanieu
haiku add pthread spinlock api
2 parents a25c853 + ed0b1b9 commit 4297ad1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/unix/haiku/mod.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,10 @@ s! {
285285
waiters: [*mut ::c_void; 2],
286286
}
287287

288+
pub struct pthread_spinlock_t {
289+
lock: u32,
290+
}
291+
288292
pub struct passwd {
289293
pub pw_name: *mut ::c_char,
290294
pub pw_passwd: *mut ::c_char,
@@ -1612,6 +1616,11 @@ extern "C" {
16121616
lock: *mut pthread_mutex_t,
16131617
abstime: *const ::timespec,
16141618
) -> ::c_int;
1619+
pub fn pthread_spin_init(lock: *mut ::pthread_spinlock_t, pshared: ::c_int) -> ::c_int;
1620+
pub fn pthread_spin_destroy(lock: *mut ::pthread_spinlock_t) -> ::c_int;
1621+
pub fn pthread_spin_lock(lock: *mut ::pthread_spinlock_t) -> ::c_int;
1622+
pub fn pthread_spin_trylock(lock: *mut ::pthread_spinlock_t) -> ::c_int;
1623+
pub fn pthread_spin_unlock(lock: *mut ::pthread_spinlock_t) -> ::c_int;
16151624
pub fn waitid(idtype: idtype_t, id: id_t, infop: *mut ::siginfo_t, options: ::c_int)
16161625
-> ::c_int;
16171626

0 commit comments

Comments
 (0)