@@ -8,21 +8,7 @@ pub type fsblkcnt_t = ::uint64_t;
8
8
pub type fsfilcnt_t = :: uint64_t ;
9
9
pub type idtype_t = :: c_int ;
10
10
pub type mqd_t = :: c_int ;
11
-
12
- cfg_if ! {
13
- if #[ cfg( any( target_arch = "aarch64" ,
14
- target_arch = "sparc" , target_arch = "sparc64" ,
15
- target_arch = "x86" , target_arch = "x86_64" ) ) ] {
16
- type __cpu_simple_lock_t = :: c_uchar;
17
- } else if #[ cfg( any( target_arch = "arm" , target_arch = "powerpc" ,
18
- target_arch = "powerpc64" ) ) ] {
19
- type __cpu_simple_lock_t = :: c_int;
20
- } else if #[ cfg( any( target_arch = "mips" , target_arch = "mips64" ) ) ] {
21
- type __cpu_simple_lock_t = :: c_uint;
22
- } else {
23
- // Unknown target_arch
24
- }
25
- }
11
+ type __pthread_spin_t = __cpu_simple_lock_nv_t ;
26
12
27
13
s ! {
28
14
pub struct aiocb {
@@ -175,11 +161,11 @@ s! {
175
161
176
162
pub struct pthread_mutex_t {
177
163
ptm_magic: :: c_uint,
178
- ptm_errorcheck: __cpu_simple_lock_t ,
164
+ ptm_errorcheck: __pthread_spin_t ,
179
165
#[ cfg( any( target_arch = "sparc" , target_arch = "sparc64" ,
180
166
target_arch = "x86" , target_arch = "x86_64" ) ) ]
181
167
ptm_pad1: [ u8 ; 3 ] ,
182
- ptm_interlock : __cpu_simple_lock_t ,
168
+ ptm_unused : __pthread_spin_t , // actually a union with a non-unused, 0-initialized field
183
169
#[ cfg( any( target_arch = "sparc" , target_arch = "sparc64" ,
184
170
target_arch = "x86" , target_arch = "x86_64" ) ) ]
185
171
ptm_pad2: [ u8 ; 3 ] ,
201
187
202
188
pub struct pthread_cond_t {
203
189
ptc_magic: :: c_uint,
204
- ptc_lock: __cpu_simple_lock_t ,
190
+ ptc_lock: __pthread_spin_t ,
205
191
ptc_waiters_first: * mut u8 ,
206
192
ptc_waiters_last: * mut u8 ,
207
193
ptc_mutex: * mut :: pthread_mutex_t,
215
201
216
202
pub struct pthread_rwlock_t {
217
203
ptr_magic: :: c_uint,
218
- ptr_interlock: __cpu_simple_lock_t ,
204
+ ptr_interlock: __pthread_spin_t ,
219
205
ptr_rblocked_first: * mut u8 ,
220
206
ptr_rblocked_last: * mut u8 ,
221
207
ptr_wblocked_first: * mut u8 ,
@@ -711,32 +697,21 @@ pub const FD_SETSIZE: usize = 0x100;
711
697
712
698
pub const ST_NOSUID : :: c_ulong = 8 ;
713
699
714
- cfg_if ! {
715
- if #[ cfg( any( target_arch = "sparc" , target_arch = "sparc64" ,
716
- target_arch = "x86" , target_arch = "x86_64" ) ) ] {
717
- pub const PTHREAD_MUTEX_INITIALIZER : pthread_mutex_t = pthread_mutex_t {
718
- ptm_magic: 0x33330003 ,
719
- ptm_errorcheck: 0 ,
720
- ptm_interlock: 0 ,
721
- ptm_waiters: 0 as * mut _,
722
- ptm_owner: 0 ,
723
- ptm_pad1: [ 0 ; 3 ] ,
724
- ptm_pad2: [ 0 ; 3 ] ,
725
- ptm_recursed: 0 ,
726
- ptm_spare2: 0 as * mut _,
727
- } ;
728
- } else {
729
- pub const PTHREAD_MUTEX_INITIALIZER : pthread_mutex_t = pthread_mutex_t {
730
- ptm_magic: 0x33330003 ,
731
- ptm_errorcheck: 0 ,
732
- ptm_interlock: 0 ,
733
- ptm_waiters: 0 as * mut _,
734
- ptm_owner: 0 ,
735
- ptm_recursed: 0 ,
736
- ptm_spare2: 0 as * mut _,
737
- } ;
738
- }
739
- }
700
+ pub const PTHREAD_MUTEX_INITIALIZER : pthread_mutex_t = pthread_mutex_t {
701
+ ptm_magic : 0x33330003 ,
702
+ ptm_errorcheck : 0 ,
703
+ #[ cfg( any( target_arch = "sparc" , target_arch = "sparc64" ,
704
+ target_arch = "x86" , target_arch = "x86_64" ) ) ]
705
+ ptm_pad1 : [ 0 ; 3 ] ,
706
+ ptm_unused : 0 ,
707
+ #[ cfg( any( target_arch = "sparc" , target_arch = "sparc64" ,
708
+ target_arch = "x86" , target_arch = "x86_64" ) ) ]
709
+ ptm_pad2 : [ 0 ; 3 ] ,
710
+ ptm_waiters : 0 as * mut _ ,
711
+ ptm_owner : 0 ,
712
+ ptm_recursed : 0 ,
713
+ ptm_spare2 : 0 as * mut _ ,
714
+ } ;
740
715
741
716
pub const PTHREAD_COND_INITIALIZER : pthread_cond_t = pthread_cond_t {
742
717
ptc_magic : 0x55550005 ,
0 commit comments