@@ -112,6 +112,9 @@ pub type thread_latency_qos_policy_t = *mut thread_latency_qos_policy;
112
112
pub type thread_throughput_qos_policy_data_t = thread_throughput_qos_policy ;
113
113
pub type thread_throughput_qos_policy_t = * mut thread_throughput_qos_policy ;
114
114
115
+ pub type pthread_introspection_hook_t =
116
+ extern "C" fn ( event : :: c_uint , thread : :: pthread_t , addr : * mut :: c_void , size : :: size_t ) ;
117
+
115
118
pub type vm_statistics_t = * mut vm_statistics ;
116
119
pub type vm_statistics_data_t = vm_statistics ;
117
120
pub type vm_statistics64_t = * mut vm_statistics64 ;
@@ -2959,6 +2962,11 @@ pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x0020;
2959
2962
pub const AT_SYMLINK_FOLLOW : :: c_int = 0x0040 ;
2960
2963
pub const AT_REMOVEDIR : :: c_int = 0x0080 ;
2961
2964
2965
+ pub const PTHREAD_INTROSPECTION_THREAD_CREATE : :: c_uint = 1 ;
2966
+ pub const PTHREAD_INTROSPECTION_THREAD_START : :: c_uint = 2 ;
2967
+ pub const PTHREAD_INTROSPECTION_THREAD_TERMINATE : :: c_uint = 3 ;
2968
+ pub const PTHREAD_INTROSPECTION_THREAD_DESTROY : :: c_uint = 4 ;
2969
+
2962
2970
pub const TIOCMODG : :: c_ulong = 0x40047403 ;
2963
2971
pub const TIOCMODS : :: c_ulong = 0x80047404 ;
2964
2972
pub const TIOCM_LE : :: c_int = 0x1 ;
@@ -4851,6 +4859,21 @@ extern "C" {
4851
4859
policy : :: c_int ,
4852
4860
param : * const sched_param ,
4853
4861
) -> :: c_int ;
4862
+
4863
+ // Available from Big Sur
4864
+ pub fn pthread_introspection_hook_install (
4865
+ hook : :: pthread_introspection_hook_t ,
4866
+ ) -> :: pthread_introspection_hook_t ;
4867
+ pub fn pthread_introspection_setspecific_np (
4868
+ thread : :: pthread_t ,
4869
+ key : :: pthread_key_t ,
4870
+ value : * const :: c_void ,
4871
+ ) -> :: c_int ;
4872
+ pub fn pthread_introspection_getspecific_np (
4873
+ thread : :: pthread_t ,
4874
+ key : :: pthread_key_t ,
4875
+ ) -> * mut :: c_void ;
4876
+
4854
4877
pub fn thread_policy_set (
4855
4878
thread : thread_t ,
4856
4879
flavor : thread_policy_flavor_t ,
0 commit comments