From 84dc9dfb24409ef16280c8e6d0d013336517ea15 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 4 Apr 2016 06:17:36 +0200 Subject: score: Use red-black tree for active MP proxies Update #2555. --- cpukit/score/include/rtems/score/thread.h | 6 ++++-- cpukit/score/include/rtems/score/threadmp.h | 29 ++--------------------------- 2 files changed, 6 insertions(+), 29 deletions(-) (limited to 'cpukit/score/include/rtems') diff --git a/cpukit/score/include/rtems/score/thread.h b/cpukit/score/include/rtems/score/thread.h index 7bb65e418c..d9f1eb2d6d 100644 --- a/cpukit/score/include/rtems/score/thread.h +++ b/cpukit/score/include/rtems/score/thread.h @@ -431,8 +431,10 @@ typedef struct { */ Objects_Id thread_queue_id; - /** This field is used to manage the set of proxies in the system. */ - Chain_Node Active; + /** + * @brief This field is used to manage the set of active proxies in the system. + */ + RBTree_Node Active; /** * @brief Provide thread queue heads for this thread proxy. diff --git a/cpukit/score/include/rtems/score/threadmp.h b/cpukit/score/include/rtems/score/threadmp.h index d2877806c6..5dc5c7ebec 100644 --- a/cpukit/score/include/rtems/score/threadmp.h +++ b/cpukit/score/include/rtems/score/threadmp.h @@ -69,26 +69,12 @@ Thread_Control *_Thread_MP_Allocate_proxy ( * id from the active chain of proxy control blocks. * * This function removes the proxy control block for the specified - * id from the active chain of proxy control blocks. + * id from the active red-black tree of proxy control blocks. */ Thread_Control *_Thread_MP_Find_proxy ( Objects_Id the_id ); -/** - * @brief Manage the active set MP proxies. - * - * The following chain is used to manage the active set proxies. - */ -extern Chain_Control _Thread_MP_Active_proxies; - -/** - * @brief Manage the inactive set of MP proxies. - * - * The following chain is used to manage the inactive set of proxies. - */ -extern Chain_Control _Thread_MP_Inactive_proxies; - /** * This function returns true if the thread in question is the * multiprocessing receive thread. @@ -103,19 +89,8 @@ extern Chain_Control _Thread_MP_Inactive_proxies; * This routine frees a proxy control block to the * inactive chain of free proxy control blocks. */ +void _Thread_MP_Free_proxy( Thread_Control *the_thread ); -RTEMS_INLINE_ROUTINE void _Thread_MP_Free_proxy ( - Thread_Control *the_thread -) -{ - Thread_Proxy_control *the_proxy; - - the_proxy = (Thread_Proxy_control *) the_thread; - - _Chain_Extract( &the_proxy->Active ); - - _Chain_Append( &_Thread_MP_Inactive_proxies, &the_thread->Object.Node ); -} /**@}*/ -- cgit v1.2.3