[Xenomai-git] Gilles Chanteperdrix : threadobj: move calls to debug after threadobj key initialization
Module: xenomai-gch Branch: for-forge Commit: f6196d62378c99cd7cae7974f7e12e0e3ae05a2f URL: http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=f6196d62378c99cd7cae7974f7e12e0e3ae05a2f Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org Date: Mon Nov 7 21:32:24 2011 +0100 threadobj: move calls to debug after threadobj key initialization as debug uses threadobj_current(). --- lib/copperplate/threadobj.c | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/copperplate/threadobj.c b/lib/copperplate/threadobj.c index 685e979..8025786 100644 --- a/lib/copperplate/threadobj.c +++ b/lib/copperplate/threadobj.c @@ -689,7 +689,7 @@ int threadobj_start_rr(struct timespec *quantum) value.it_interval.tv_sec = quantum-tv_sec; value.it_interval.tv_usec = quantum-tv_nsec / 1000; - + ret = getitimer(ITIMER_VIRTUAL, ovalue); if (ret == 0 value.it_interval.tv_sec == ovalue.it_interval.tv_sec @@ -718,7 +718,7 @@ void threadobj_stop_rr(void) value.it_value.tv_sec = 0; value.it_value.tv_usec = 0; value.it_interval = value.it_value; - + setitimer(ITIMER_VIRTUAL, value, NULL); memset(sa, 0, sizeof(sa)); @@ -774,7 +774,7 @@ int threadobj_wait_period(struct threadobj *thobj, overruns = d / period; timespec_adds(wakeup, wakeup, overruns * period); } - + timespec_adds(thobj-core.wakeup, wakeup, period); if (overruns) @@ -1029,14 +1029,14 @@ void threadobj_pkg_init(void) threadobj_irq_prio = __RT(sched_get_priority_max(SCHED_RT)); threadobj_high_prio = threadobj_irq_prio - 1; - debug(SCHED_RT priorities = [1 .. %d], threadobj_irq_prio); - debug(SCHED_RT.%d reserved for timer context, threadobj_irq_prio); - /* PI and recursion would be overkill. */ __RT(pthread_mutex_init(list_lock, NULL)); if (pthread_key_create(threadobj_tskey, threadobj_finalize) != 0) panic(failed to allocate TSD key); + debug(SCHED_RT priorities = [1 .. %d], threadobj_irq_prio); + debug(SCHED_RT.%d reserved for timer context, threadobj_irq_prio); + pkg_init_corespec(); } ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Gilles Chanteperdrix : threadobj: move calls to debug after threadobj key initialization
Module: xenomai-forge Branch: master Commit: f6196d62378c99cd7cae7974f7e12e0e3ae05a2f URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=f6196d62378c99cd7cae7974f7e12e0e3ae05a2f Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org Date: Mon Nov 7 21:32:24 2011 +0100 threadobj: move calls to debug after threadobj key initialization as debug uses threadobj_current(). --- lib/copperplate/threadobj.c | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/copperplate/threadobj.c b/lib/copperplate/threadobj.c index 685e979..8025786 100644 --- a/lib/copperplate/threadobj.c +++ b/lib/copperplate/threadobj.c @@ -689,7 +689,7 @@ int threadobj_start_rr(struct timespec *quantum) value.it_interval.tv_sec = quantum-tv_sec; value.it_interval.tv_usec = quantum-tv_nsec / 1000; - + ret = getitimer(ITIMER_VIRTUAL, ovalue); if (ret == 0 value.it_interval.tv_sec == ovalue.it_interval.tv_sec @@ -718,7 +718,7 @@ void threadobj_stop_rr(void) value.it_value.tv_sec = 0; value.it_value.tv_usec = 0; value.it_interval = value.it_value; - + setitimer(ITIMER_VIRTUAL, value, NULL); memset(sa, 0, sizeof(sa)); @@ -774,7 +774,7 @@ int threadobj_wait_period(struct threadobj *thobj, overruns = d / period; timespec_adds(wakeup, wakeup, overruns * period); } - + timespec_adds(thobj-core.wakeup, wakeup, period); if (overruns) @@ -1029,14 +1029,14 @@ void threadobj_pkg_init(void) threadobj_irq_prio = __RT(sched_get_priority_max(SCHED_RT)); threadobj_high_prio = threadobj_irq_prio - 1; - debug(SCHED_RT priorities = [1 .. %d], threadobj_irq_prio); - debug(SCHED_RT.%d reserved for timer context, threadobj_irq_prio); - /* PI and recursion would be overkill. */ __RT(pthread_mutex_init(list_lock, NULL)); if (pthread_key_create(threadobj_tskey, threadobj_finalize) != 0) panic(failed to allocate TSD key); + debug(SCHED_RT priorities = [1 .. %d], threadobj_irq_prio); + debug(SCHED_RT.%d reserved for timer context, threadobj_irq_prio); + pkg_init_corespec(); } ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git