From ecacf536b0f70b9b9579910c7d6dd8b5a9608136 Mon Sep 17 00:00:00 2001 From: davidxu Date: Wed, 12 Jul 2006 06:13:18 +0000 Subject: Use kernel facilities to support real-time scheduling. --- lib/libthr/thread/thr_init.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'lib/libthr/thread/thr_init.c') 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 #include #include +#include #include #include #include @@ -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); -- cgit v1.1