@@ -121,6 +121,9 @@ pub type pthread_introspection_hook_t =
121
121
extern "C" fn ( event : :: c_uint , thread : :: pthread_t , addr : * mut :: c_void , size : :: size_t ) ;
122
122
pub type pthread_jit_write_callback_t = :: Option < extern "C" fn ( ctx : * mut :: c_void ) -> :: c_int > ;
123
123
124
+ pub type os_unfair_lock = os_unfair_lock_s ;
125
+ pub type os_unfair_lock_t = * mut os_unfair_lock ;
126
+
124
127
pub type vm_statistics_t = * mut vm_statistics ;
125
128
pub type vm_statistics_data_t = vm_statistics ;
126
129
pub type vm_statistics64_t = * mut vm_statistics64 ;
@@ -1295,6 +1298,10 @@ s_no_extra_traits! {
1295
1298
pub l2p_contigbytes: :: off_t,
1296
1299
pub l2p_devoffset: :: off_t,
1297
1300
}
1301
+
1302
+ pub struct os_unfair_lock_s {
1303
+ _os_unfair_lock_opaque: u32 ,
1304
+ }
1298
1305
}
1299
1306
1300
1307
impl siginfo_t {
@@ -2576,6 +2583,27 @@ cfg_if! {
2576
2583
l2p_devoffset. hash( state) ;
2577
2584
}
2578
2585
}
2586
+ impl PartialEq for os_unfair_lock {
2587
+ fn eq( & self , other: & os_unfair_lock) -> bool {
2588
+ self . _os_unfair_lock_opaque == other. _os_unfair_lock_opaque
2589
+ }
2590
+ }
2591
+
2592
+ impl Eq for os_unfair_lock { }
2593
+
2594
+ impl :: fmt:: Debug for os_unfair_lock {
2595
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
2596
+ f. debug_struct( "os_unfair_lock" )
2597
+ . field( "_os_unfair_lock_opaque" , & self . _os_unfair_lock_opaque)
2598
+ . finish( )
2599
+ }
2600
+ }
2601
+
2602
+ impl :: hash:: Hash for os_unfair_lock {
2603
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
2604
+ self . _os_unfair_lock_opaque. hash( state) ;
2605
+ }
2606
+ }
2579
2607
}
2580
2608
}
2581
2609
@@ -3863,6 +3891,10 @@ pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t {
3863
3891
__opaque : [ 0 ; __PTHREAD_RWLOCK_SIZE__] ,
3864
3892
} ;
3865
3893
3894
+ pub const OS_UNFAIR_LOCK_INIT : os_unfair_lock = os_unfair_lock {
3895
+ _os_unfair_lock_opaque : 0 ,
3896
+ } ;
3897
+
3866
3898
pub const MINSIGSTKSZ : :: size_t = 32768 ;
3867
3899
pub const SIGSTKSZ : :: size_t = 131072 ;
3868
3900
@@ -5221,6 +5253,12 @@ extern "C" {
5221
5253
pub fn pthread_jit_write_freeze_callbacks_np ( ) ;
5222
5254
pub fn pthread_cpu_number_np ( cpu_number_out : * mut :: size_t ) -> :: c_int ;
5223
5255
5256
+ pub fn os_unfair_lock_lock ( lock : os_unfair_lock_t ) ;
5257
+ pub fn os_unfair_lock_trylock ( lock : os_unfair_lock_t ) -> bool ;
5258
+ pub fn os_unfair_lock_unlock ( lock : os_unfair_lock_t ) ;
5259
+ pub fn os_unfair_lock_assert_owner ( lock : os_unfair_lock_t ) ;
5260
+ pub fn os_unfair_lock_assert_not_owner ( lock : os_unfair_lock_t ) ;
5261
+
5224
5262
pub fn thread_policy_set (
5225
5263
thread : thread_t ,
5226
5264
flavor : thread_policy_flavor_t ,
0 commit comments