mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-05 19:35:52 +03:00
nptl: Move the internal thread priority protection symbols into libc
This is a prerequisite for moving the mutex implementation. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
This commit is contained in:
@@ -94,6 +94,7 @@ routines = \
|
|||||||
pthread_setschedparam \
|
pthread_setschedparam \
|
||||||
pthread_setspecific \
|
pthread_setspecific \
|
||||||
pthread_sigmask \
|
pthread_sigmask \
|
||||||
|
tpp \
|
||||||
unwind \
|
unwind \
|
||||||
|
|
||||||
shared-only-routines = forward
|
shared-only-routines = forward
|
||||||
@@ -214,7 +215,6 @@ libpthread-routines = \
|
|||||||
sem_timedwait \
|
sem_timedwait \
|
||||||
sem_unlink \
|
sem_unlink \
|
||||||
sem_wait \
|
sem_wait \
|
||||||
tpp \
|
|
||||||
vars \
|
vars \
|
||||||
version \
|
version \
|
||||||
|
|
||||||
|
@@ -120,6 +120,7 @@ libc {
|
|||||||
GLIBC_PRIVATE {
|
GLIBC_PRIVATE {
|
||||||
__futex_abstimed_wait64;
|
__futex_abstimed_wait64;
|
||||||
__futex_abstimed_wait_cancelable64;
|
__futex_abstimed_wait_cancelable64;
|
||||||
|
__init_sched_fifo_prio;
|
||||||
__libc_alloca_cutoff;
|
__libc_alloca_cutoff;
|
||||||
__libc_cleanup_pop_restore;
|
__libc_cleanup_pop_restore;
|
||||||
__libc_cleanup_push_defer;
|
__libc_cleanup_push_defer;
|
||||||
@@ -143,13 +144,17 @@ libc {
|
|||||||
__pthread_cleanup_upto;
|
__pthread_cleanup_upto;
|
||||||
__pthread_cond_destroy; # Used by the C11 threads.
|
__pthread_cond_destroy; # Used by the C11 threads.
|
||||||
__pthread_cond_init; # Used by the C11 threads.
|
__pthread_cond_init; # Used by the C11 threads.
|
||||||
|
__pthread_current_priority;
|
||||||
__pthread_exit;
|
__pthread_exit;
|
||||||
__pthread_force_elision;
|
__pthread_force_elision;
|
||||||
__pthread_getattr_default_np;
|
__pthread_getattr_default_np;
|
||||||
__pthread_key_delete;
|
__pthread_key_delete;
|
||||||
__pthread_keys;
|
__pthread_keys;
|
||||||
__pthread_setcancelstate;
|
__pthread_setcancelstate;
|
||||||
|
__pthread_tpp_change_priority;
|
||||||
__pthread_unwind;
|
__pthread_unwind;
|
||||||
|
__sched_fifo_max_prio;
|
||||||
|
__sched_fifo_min_prio;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -231,12 +231,16 @@ rtld_hidden_proto (__nptl_set_robust_list_avail)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Thread Priority Protection. */
|
/* Thread Priority Protection. */
|
||||||
extern int __sched_fifo_min_prio attribute_hidden;
|
extern int __sched_fifo_min_prio;
|
||||||
extern int __sched_fifo_max_prio attribute_hidden;
|
libc_hidden_proto (__sched_fifo_min_prio)
|
||||||
extern void __init_sched_fifo_prio (void) attribute_hidden;
|
extern int __sched_fifo_max_prio;
|
||||||
extern int __pthread_tpp_change_priority (int prev_prio, int new_prio)
|
libc_hidden_proto (__sched_fifo_max_prio)
|
||||||
attribute_hidden;
|
extern void __init_sched_fifo_prio (void);
|
||||||
extern int __pthread_current_priority (void) attribute_hidden;
|
libc_hidden_proto (__init_sched_fifo_prio)
|
||||||
|
extern int __pthread_tpp_change_priority (int prev_prio, int new_prio);
|
||||||
|
libc_hidden_proto (__pthread_tpp_change_priority)
|
||||||
|
extern int __pthread_current_priority (void);
|
||||||
|
libc_hidden_proto (__pthread_current_priority)
|
||||||
|
|
||||||
/* The library can run in debugging mode where it performs a lot more
|
/* The library can run in debugging mode where it performs a lot more
|
||||||
tests. */
|
tests. */
|
||||||
|
@@ -25,9 +25,10 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <atomic.h>
|
#include <atomic.h>
|
||||||
|
|
||||||
|
|
||||||
int __sched_fifo_min_prio = -1;
|
int __sched_fifo_min_prio = -1;
|
||||||
|
libc_hidden_data_def (__sched_fifo_min_prio)
|
||||||
int __sched_fifo_max_prio = -1;
|
int __sched_fifo_max_prio = -1;
|
||||||
|
libc_hidden_data_def (__sched_fifo_max_prio)
|
||||||
|
|
||||||
/* We only want to initialize __sched_fifo_min_prio and __sched_fifo_max_prio
|
/* We only want to initialize __sched_fifo_min_prio and __sched_fifo_max_prio
|
||||||
once. The standard solution would be similar to pthread_once, but then
|
once. The standard solution would be similar to pthread_once, but then
|
||||||
@@ -47,6 +48,7 @@ __init_sched_fifo_prio (void)
|
|||||||
atomic_store_relaxed (&__sched_fifo_min_prio,
|
atomic_store_relaxed (&__sched_fifo_min_prio,
|
||||||
__sched_get_priority_min (SCHED_FIFO));
|
__sched_get_priority_min (SCHED_FIFO));
|
||||||
}
|
}
|
||||||
|
libc_hidden_def (__init_sched_fifo_prio)
|
||||||
|
|
||||||
int
|
int
|
||||||
__pthread_tpp_change_priority (int previous_prio, int new_prio)
|
__pthread_tpp_change_priority (int previous_prio, int new_prio)
|
||||||
@@ -155,6 +157,7 @@ __pthread_tpp_change_priority (int previous_prio, int new_prio)
|
|||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
libc_hidden_def (__pthread_tpp_change_priority)
|
||||||
|
|
||||||
int
|
int
|
||||||
__pthread_current_priority (void)
|
__pthread_current_priority (void)
|
||||||
@@ -193,3 +196,4 @@ __pthread_current_priority (void)
|
|||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
libc_hidden_def (__pthread_current_priority)
|
||||||
|
Reference in New Issue
Block a user