aienux
Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.
Brought by drakestapleton
aienux / vendor / libc / src / new / apple / libpthread / pthread_ / pthread.rs
| 1 | //! Header: `pthread.h` or `pthread/pthread.h` |
| 2 | //! |
| 3 | //! <https://github.com/apple-oss-distributions/libpthread/blob/main/include/pthread/pthread.h> |
| 4 | |
| 5 | use crate::prelude::*; |
| 6 | pub use crate::pthread_::qos::*; |
| 7 | pub use crate::pthread_::sched::*; |
| 8 | // No need to import from the `_pthread_attr_t` and similar modules since `_pthread_types` has |
| 9 | // everything we need. |
| 10 | pub use crate::sys::_pthread::_pthread_types::*; |
| 11 | |
| 12 | pub const PTHREAD_CREATE_JOINABLE: c_int = 1; |
| 13 | pub const PTHREAD_CREATE_DETACHED: c_int = 2; |
| 14 | |
| 15 | pub const PTHREAD_INHERIT_SCHED: c_int = 1; |
| 16 | pub const PTHREAD_EXPLICIT_SCHED: c_int = 2; |
| 17 | |
| 18 | pub const PTHREAD_CANCEL_ENABLE: c_int = 0x01; |
| 19 | pub const PTHREAD_CANCEL_DISABLE: c_int = 0x00; |
| 20 | pub const PTHREAD_CANCEL_DEFERRED: c_int = 0x02; |
| 21 | pub const PTHREAD_CANCEL_ASYNCHRONOUS: c_int = 0x00; |
| 22 | |
| 23 | pub const PTHREAD_CANCELED: *mut c_void = 1 as *mut c_void; |
| 24 | |
| 25 | pub const PTHREAD_SCOPE_SYSTEM: c_int = 1; |
| 26 | pub const PTHREAD_SCOPE_PROCESS: c_int = 2; |
| 27 | |
| 28 | pub const PTHREAD_PROCESS_SHARED: c_int = 1; |
| 29 | pub const PTHREAD_PROCESS_PRIVATE: c_int = 2; |
| 30 | |
| 31 | pub const PTHREAD_PRIO_NONE: c_int = 0; |
| 32 | pub const PTHREAD_PRIO_INHERIT: c_int = 1; |
| 33 | pub const PTHREAD_PRIO_PROTECT: c_int = 2; |
| 34 | |
| 35 | pub const PTHREAD_MUTEX_NORMAL: c_int = 0; |
| 36 | pub const PTHREAD_MUTEX_ERRORCHECK: c_int = 1; |
| 37 | pub const PTHREAD_MUTEX_RECURSIVE: c_int = 2; |
| 38 | pub const PTHREAD_MUTEX_DEFAULT: c_int = PTHREAD_MUTEX_NORMAL; |
| 39 | |
| 40 | pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { |
| 41 | __sig: _PTHREAD_RWLOCK_SIG_init, |
| 42 | __opaque: [0; __PTHREAD_RWLOCK_SIZE__], |
| 43 | }; |
| 44 | |
| 45 | pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { |
| 46 | __sig: _PTHREAD_MUTEX_SIG_init, |
| 47 | __opaque: [0; __PTHREAD_MUTEX_SIZE__], |
| 48 | }; |
| 49 | |
| 50 | pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { |
| 51 | __sig: _PTHREAD_COND_SIG_init, |
| 52 | __opaque: [0; __PTHREAD_COND_SIZE__], |
| 53 | }; |
| 54 | |
| 55 | pub const PTHREAD_ONCE_INIT: crate::pthread_once_t = crate::pthread_once_t { |
| 56 | __sig: _PTHREAD_ONCE_SIG_INIT, |
| 57 | __opaque: [0; __PTHREAD_ONCE_SIZE__], |
| 58 | }; |
| 59 | |
| 60 | pub use crate::new::common::posix::pthread::{ |
| 61 | pthread_attr_getinheritsched, |
| 62 | pthread_attr_getschedparam, |
| 63 | pthread_attr_getschedpolicy, |
| 64 | pthread_attr_setinheritsched, |
| 65 | pthread_attr_setschedparam, |
| 66 | pthread_attr_setschedpolicy, |
| 67 | pthread_condattr_getpshared, |
| 68 | pthread_condattr_setpshared, |
| 69 | pthread_getschedparam, |
| 70 | pthread_mutexattr_getpshared, |
| 71 | pthread_mutexattr_setpshared, |
| 72 | pthread_once, |
| 73 | pthread_rwlockattr_getpshared, |
| 74 | pthread_rwlockattr_setpshared, |
| 75 | pthread_setschedparam, |
| 76 | }; |