Skip to content

Commit 3c2d4c6

Browse files
committed
Auto merge of #2251 - devnexen:android_impl_barrier, r=JohnTitor
adding pthread barrier to android
2 parents 04a4b8c + 5436f98 commit 3c2d4c6

File tree

4 files changed

+35
-0
lines changed

4 files changed

+35
-0
lines changed

libc-test/semver/android.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2946,6 +2946,15 @@ pthread_attr_init
29462946
pthread_attr_setdetachstate
29472947
pthread_attr_setstacksize
29482948
pthread_attr_t
2949+
pthread_barrierattr_destroy
2950+
pthread_barrierattr_getpshared
2951+
pthread_barrierattr_init
2952+
pthread_barrierattr_setpshared
2953+
pthread_barrierattr_t
2954+
pthread_barrier_destroy
2955+
pthread_barrier_init
2956+
pthread_barrier_wait
2957+
pthread_barrier_t
29492958
pthread_cond_broadcast
29502959
pthread_cond_destroy
29512960
pthread_cond_init

src/unix/linux_like/android/b32/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ s! {
120120
__reserved: [::c_char; 12],
121121
}
122122

123+
pub struct pthread_barrier_t {
124+
__private: [i32; 8],
125+
}
126+
123127
pub struct pthread_spinlock_t {
124128
__private: [i32; 2],
125129
}

src/unix/linux_like/android/b64/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ s! {
106106
__f_spare: [::c_int; 6],
107107
}
108108

109+
pub struct pthread_barrier_t {
110+
__private: [i64; 4],
111+
}
112+
109113
pub struct pthread_spinlock_t {
110114
__private: i64,
111115
}

src/unix/linux_like/android/mod.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ pub type useconds_t = u32;
1111
pub type pthread_t = ::c_long;
1212
pub type pthread_mutexattr_t = ::c_long;
1313
pub type pthread_rwlockattr_t = ::c_long;
14+
pub type pthread_barrierattr_t = ::c_int;
1415
pub type pthread_condattr_t = ::c_long;
1516
pub type pthread_key_t = ::c_int;
1617
pub type fsfilcnt_t = ::c_ulong;
@@ -2677,6 +2678,23 @@ extern "C" {
26772678
lock: *mut pthread_mutex_t,
26782679
abstime: *const ::timespec,
26792680
) -> ::c_int;
2681+
pub fn pthread_barrierattr_init(attr: *mut ::pthread_barrierattr_t) -> ::c_int;
2682+
pub fn pthread_barrierattr_destroy(attr: *mut ::pthread_barrierattr_t) -> ::c_int;
2683+
pub fn pthread_barrierattr_getpshared(
2684+
attr: *const ::pthread_barrierattr_t,
2685+
shared: *mut ::c_int,
2686+
) -> ::c_int;
2687+
pub fn pthread_barrierattr_setpshared(
2688+
attr: *mut ::pthread_barrierattr_t,
2689+
shared: ::c_int,
2690+
) -> ::c_int;
2691+
pub fn pthread_barrier_init(
2692+
barrier: *mut pthread_barrier_t,
2693+
attr: *const ::pthread_barrierattr_t,
2694+
count: ::c_uint,
2695+
) -> ::c_int;
2696+
pub fn pthread_barrier_destroy(barrier: *mut pthread_barrier_t) -> ::c_int;
2697+
pub fn pthread_barrier_wait(barrier: *mut pthread_barrier_t) -> ::c_int;
26802698
pub fn pthread_spin_init(lock: *mut ::pthread_spinlock_t, pshared: ::c_int) -> ::c_int;
26812699
pub fn pthread_spin_destroy(lock: *mut ::pthread_spinlock_t) -> ::c_int;
26822700
pub fn pthread_spin_lock(lock: *mut ::pthread_spinlock_t) -> ::c_int;

0 commit comments

Comments
 (0)