diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-03-17 16:28:50 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-03-24 14:35:04 +0100 |
commit | 2e9c3d5e2944a8782eac8a12d23af7559873ad0a (patch) | |
tree | d19a9f00f4ca76811e3e4d25af5b48f50a2d47c1 /cpukit/score/src/threadinitialize.c | |
parent | cpukit/libmisc/utf8proc/utf8proc.c: Avoid overflow (diff) | |
download | rtems-2e9c3d5e2944a8782eac8a12d23af7559873ad0a.tar.bz2 |
score: Add thread priority change handler
Since the thread current priority change and thread queue requeue is
performed in one critical section it is possible to simplify the thread
queue requeue procedure. Add a thread queue agnostic thread priority
change handler so that we are able to use alternative thread queue
implementations.
Update #2273.
Diffstat (limited to 'cpukit/score/src/threadinitialize.c')
-rw-r--r-- | cpukit/score/src/threadinitialize.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/cpukit/score/src/threadinitialize.c b/cpukit/score/src/threadinitialize.c index 993d95fdb8..b0066cd19a 100644 --- a/cpukit/score/src/threadinitialize.c +++ b/cpukit/score/src/threadinitialize.c @@ -29,6 +29,15 @@ #include <rtems/score/cpusetimpl.h> #include <rtems/config.h> +void _Thread_Priority_change_do_nothing( + Thread_Control *the_thread, + Priority_Control new_priority, + void *context +) +{ + /* Do nothing */ +} + bool _Thread_Initialize( Objects_Information *information, Thread_Control *the_thread, @@ -198,7 +207,8 @@ bool _Thread_Initialize( the_thread->Wait.queue = NULL; the_thread->resource_count = 0; the_thread->real_priority = priority; - the_thread->priority_generation = 0; + the_thread->Priority.generation = 0; + the_thread->Priority.change_handler = _Thread_Priority_change_do_nothing; the_thread->Start.initial_priority = priority; _Thread_Wait_flags_set( the_thread, THREAD_WAIT_FLAGS_INITIAL ); |