Skip to content

Commit

Permalink
Auto merge of #2328 - vaffeine:add-macos-pthread_mach_thread_np, r=Am…
Browse files Browse the repository at this point in the history
…anieu

Add mac/ios pthread_mach_thread_np

This function allow to retrieve the mach thread bound to the pthread.
From [pthread.h](https://opensource.apple.com/source/libpthread/libpthread-416.40.3/pthread/pthread.h.auto.html):

```
__API_AVAILABLE(macos(10.4), ios(2.0))
mach_port_t pthread_mach_thread_np(pthread_t);
```
  • Loading branch information
bors committed Aug 9, 2021
2 parents 49c8a5e + 5d43c89 commit 485507c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/unix/bsd/apple/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3980,6 +3980,7 @@ extern "C" {
pub fn mach_thread_self() -> mach_port_t;
pub fn pthread_setname_np(name: *const ::c_char) -> ::c_int;
pub fn pthread_getname_np(thread: ::pthread_t, name: *mut ::c_char, len: ::size_t) -> ::c_int;
pub fn pthread_mach_thread_np(thread: ::pthread_t) -> ::mach_port_t;
pub fn pthread_from_mach_thread_np(port: ::mach_port_t) -> ::pthread_t;
pub fn pthread_get_stackaddr_np(thread: ::pthread_t) -> *mut ::c_void;
pub fn pthread_get_stacksize_np(thread: ::pthread_t) -> ::size_t;
Expand Down

0 comments on commit 485507c

Please sign in to comment.