diff options
author | davidxu <davidxu@FreeBSD.org> | 2006-07-12 06:13:18 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2006-07-12 06:13:18 +0000 |
commit | ecacf536b0f70b9b9579910c7d6dd8b5a9608136 (patch) | |
tree | f3ebabe7f0c598fbcd24fc997f7310e276d3efb0 /lib/libthr/thread/thr_init.c | |
parent | 3117fa3da4d89744ddfe45c3ac759ab430bd2950 (diff) | |
download | FreeBSD-src-ecacf536b0f70b9b9579910c7d6dd8b5a9608136.zip FreeBSD-src-ecacf536b0f70b9b9579910c7d6dd8b5a9608136.tar.gz |
Use kernel facilities to support real-time scheduling.
Diffstat (limited to 'lib/libthr/thread/thr_init.c')
-rw-r--r-- | lib/libthr/thread/thr_init.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/lib/libthr/thread/thr_init.c b/lib/libthr/thread/thr_init.c index 40365a0..99bcea3 100644 --- a/lib/libthr/thread/thr_init.c +++ b/lib/libthr/thread/thr_init.c @@ -40,6 +40,7 @@ #include <sys/sysctl.h> #include <sys/ttycom.h> #include <sys/mman.h> +#include <sys/rtprio.h> #include <errno.h> #include <fcntl.h> #include <paths.h> @@ -67,14 +68,10 @@ int _thread_active_threads = 1; atfork_head _thr_atfork_list = TAILQ_HEAD_INITIALIZER(_thr_atfork_list); umtx_t _thr_atfork_lock; -/* - * XXX these values should be updated from kernel at startup, - * but current they are same. - */ struct pthread_prio _thr_priorities[3] = { - {0, 31, 0}, /* FIF0 */ - {-20, 20, 0}, /* OTHER */ - {0, 31, 0} /* RR */ + {RTP_PRIO_MIN, RTP_PRIO_MAX, 0}, /* FIFO */ + {0, 0, 63}, /* OTHER */ + {RTP_PRIO_MIN, RTP_PRIO_MAX, 0} /* RR */ }; struct pthread_attr _pthread_attr_default = { @@ -156,8 +153,6 @@ STATIC_LIB_REQUIRE(_sendto); STATIC_LIB_REQUIRE(_sigaction); STATIC_LIB_REQUIRE(_sigprocmask); STATIC_LIB_REQUIRE(_sigsuspend); -STATIC_LIB_REQUIRE(_socket); -STATIC_LIB_REQUIRE(_socketpair); STATIC_LIB_REQUIRE(_thread_init_hack); STATIC_LIB_REQUIRE(_wait4); STATIC_LIB_REQUIRE(_write); @@ -407,11 +402,6 @@ init_main_thread(struct pthread *thread) thread->cancelflags = PTHREAD_CANCEL_ENABLE | PTHREAD_CANCEL_DEFERRED; thr_set_name(thread->tid, "initial thread"); - /* Default the priority of the initial thread: */ - thread->base_priority = THR_DEF_PRIORITY; - thread->active_priority = THR_DEF_PRIORITY; - thread->inherited_priority = 0; - /* Initialize the mutex queue: */ TAILQ_INIT(&thread->mutexq); |