Apple: Add additional `pthread` APIs
Resolves #1618
It seems like #1618 has already been mostly resolved; this PR simply adds some of the few pthread APIs that are still missing.
r? @JohnTitor
rustbot has assigned @JohnTitor. They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.
Use r? to explicitly pick a reviewer
r? @tgross35
Sources for future reference:
- Type
pthread_once_tis defined as_opaque_pthread_once_there https://github.com/apple-oss-distributions/libpthread/blob/d8c4e3c212553d3e0f5d76bb7d45a8acd61302dc/include/sys/_pthread/_pthread_types.h#L88-L91. - Opaque padding
__PTHREAD_ONCE_SIZE__is defined to 4/8 here https://github.com/apple-oss-distributions/libpthread/blob/d8c4e3c212553d3e0f5d76bb7d45a8acd61302dc/include/sys/_pthread/_pthread_types.h#L42-L52 - Constants are defined here https://github.com/apple-oss-distributions/libpthread/blob/d8c4e3c212553d3e0f5d76bb7d45a8acd61302dc/include/pthread/pthread.h#L138
-
_PTHREAD_ONCE_SIG_initis defined here https://github.com/apple-oss-distributions/libpthread/blob/d8c4e3c212553d3e0f5d76bb7d45a8acd61302dc/include/pthread/pthread_impl.h#L48C33-L48C43 -
pthread_oncehttps://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/pthread_once.3.html - The remaining functions are here, some already exist or are in
unix/mod.rshttps://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/pthread_attr_getinheritsched.3.html
One fix above, then could you define __PTHREAD_ONCE_SIZE__ and make use of it in __opaque (rather than literals) like the definition? We already have e.g. __PTHREAD_RWLOCKATTR_SIZE__ defined, just unfortunately don't use them consistently.
@rustbot label -S-waiting-on-author S-waiting-on-review