Skip to content

Commit

Permalink
Auto merge of #2731 - rtzoeller:pthread_prio_inherit, r=Amanieu
Browse files Browse the repository at this point in the history
Add pthread_mutexattr_setprotocol and pthread_mutexattr_getprotocol on Linux

Include the PTHREAD_PRIO_* constants.
  • Loading branch information
bors committed Apr 24, 2022
2 parents 40d529f + 91395ae commit f6df53f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libc-test/semver/linux.txt
Expand Up @@ -1653,6 +1653,9 @@ PTHREAD_CREATE_DETACHED
PTHREAD_CREATE_JOINABLE
PTHREAD_MUTEX_DEFAULT
PTHREAD_MUTEX_ERRORCHECK
PTHREAD_PRIO_NONE
PTHREAD_PRIO_INHERIT
PTHREAD_PRIO_PROTECT
PTHREAD_PROCESS_PRIVATE
PTHREAD_PROCESS_SHARED
PTHREAD_STACK_MIN
Expand Down Expand Up @@ -2951,7 +2954,9 @@ pthread_getschedparam
pthread_kill
pthread_mutex_consistent
pthread_mutex_timedlock
pthread_mutexattr_getprotocol
pthread_mutexattr_getpshared
pthread_mutexattr_setprotocol
pthread_mutexattr_setpshared
pthread_mutexattr_getrobust
pthread_mutexattr_setrobust
Expand Down
11 changes: 11 additions & 0 deletions src/unix/linux_like/linux/mod.rs
Expand Up @@ -1519,6 +1519,9 @@ pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 2;
pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_NORMAL;
pub const PTHREAD_MUTEX_STALLED: ::c_int = 0;
pub const PTHREAD_MUTEX_ROBUST: ::c_int = 1;
pub const PTHREAD_PRIO_NONE: ::c_int = 0;
pub const PTHREAD_PRIO_INHERIT: ::c_int = 1;
pub const PTHREAD_PRIO_PROTECT: ::c_int = 2;
pub const PTHREAD_PROCESS_PRIVATE: ::c_int = 0;
pub const PTHREAD_PROCESS_SHARED: ::c_int = 1;
pub const __SIZEOF_PTHREAD_COND_T: usize = 48;
Expand Down Expand Up @@ -3788,6 +3791,14 @@ extern "C" {
timeout: *const ::timespec,
sigmask: *const sigset_t,
) -> ::c_int;
pub fn pthread_mutexattr_getprotocol(
attr: *const pthread_mutexattr_t,
protocol: *mut ::c_int,
) -> ::c_int;
pub fn pthread_mutexattr_setprotocol(
attr: *mut pthread_mutexattr_t,
protocol: ::c_int,
) -> ::c_int;
pub fn pthread_mutex_consistent(mutex: *mut pthread_mutex_t) -> ::c_int;
pub fn pthread_mutex_timedlock(
lock: *mut pthread_mutex_t,
Expand Down

0 comments on commit f6df53f

Please sign in to comment.