Changeset 833dd90 in rtems for cpukit/sapi/include


Ignore:
Timestamp:
Nov 19, 2013, 3:09:39 PM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
4ea97d24
Parents:
eea7c937
git-author:
Sebastian Huber <sebastian.huber@…> (11/19/13 15:09:39)
git-committer:
Sebastian Huber <sebastian.huber@…> (11/21/13 11:58:46)
Message:

score/rbtree: Delete protected operations

The user of the red-black tree container must now ensure that at most
one thread at once can access an instance.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/sapi/include/rtems/rbtree.h

    reea7c937 r833dd90  
    310310}
    311311
    312 /** @brief Find the node with given key in the tree.
    313  *
    314  * This function returns a pointer to the node having key equal to the key
    315  * of @a the_node if it exists within @a the_rbtree, and NULL if not.
    316  * @a the_node has to be made up before a search.
    317  *
    318  * @note If the tree is not unique and contains duplicate keys, the set
    319  *       of duplicate keys acts as FIFO.
    320  */
    321 RTEMS_INLINE_ROUTINE rtems_rbtree_node* rtems_rbtree_find(
    322   const rtems_rbtree_control *the_rbtree,
    323   const rtems_rbtree_node *the_node
    324 )
    325 {
    326   return _RBTree_Find( the_rbtree, the_node );
    327 }
    328 
    329312/**
    330313 * @copydoc _RBTree_Predecessor_unprotected()
     
    338321
    339322/**
    340  * @copydoc _RBTree_Predecessor()
    341  */
    342 RTEMS_INLINE_ROUTINE rtems_rbtree_node* rtems_rbtree_predecessor(
    343   const rtems_rbtree_node *node
    344 )
    345 {
    346   return _RBTree_Predecessor( node );
    347 }
    348 
    349 /**
    350323 * @copydoc _RBTree_Successor_unprotected()
    351324 */
     
    355328{
    356329  return _RBTree_Successor_unprotected( node );
    357 }
    358 
    359 /**
    360  * @copydoc _RBTree_Successor()
    361  */
    362 RTEMS_INLINE_ROUTINE rtems_rbtree_node* rtems_rbtree_successor(
    363   const rtems_rbtree_node *node
    364 )
    365 {
    366   return _RBTree_Successor( node );
    367330}
    368331
     
    379342
    380343/**
    381  * @brief Extract the specified node from a rbtree.
    382  *
    383  * This routine extracts @a the_node from @a the_rbtree on which it resides.
    384  * It disables interrupts to ensure the atomicity of the extract operation.
    385  */
    386 RTEMS_INLINE_ROUTINE void rtems_rbtree_extract(
    387   rtems_rbtree_control *the_rbtree,
    388   rtems_rbtree_node *the_node
    389 )
    390 {
    391   _RBTree_Extract( the_rbtree, the_node );
    392 }
    393 
    394 /**
    395344 * @brief Obtain the min node on a rbtree.
    396345 *
     
    407356
    408357/**
    409  * @brief Obtain the min node on a rbtree.
    410  *
    411  * This function removes the min node from @a the_rbtree and returns
    412  * a pointer to that node.  If @a the_rbtree is empty, then NULL is returned.
    413  * It disables interrupts to ensure the atomicity of the get operation.
    414  */
    415 RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_get_min(
    416   rtems_rbtree_control *the_rbtree
    417 )
    418 {
    419   return _RBTree_Get( the_rbtree, RBT_LEFT );
    420 }
    421 
    422 /**
    423358 * @brief Obtain the max node on a rbtree.
    424359 *
     
    432367{
    433368  return _RBTree_Get_unprotected( the_rbtree, RBT_RIGHT );
    434 }
    435 
    436 /**
    437  * @brief Obtain the max node on a rbtree.
    438  *
    439  * This function removes the max node from @a the_rbtree and returns
    440  * a pointer to that node.  If @a the_rbtree is empty, then NULL is returned.
    441  * It disables interrupts to ensure the atomicity of the get operation.
    442  */
    443 RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_get_max(
    444   rtems_rbtree_control *the_rbtree
    445 )
    446 {
    447   return _RBTree_Get( the_rbtree, RBT_RIGHT );
    448369}
    449370
     
    487408
    488409/**
    489  * @brief Find the control header of the tree containing a given node.
    490  *
    491  * This routine finds the rtems_rbtree_control structure of the tree
    492  * containing @a the_node.
    493  * It disables interrupts to ensure the atomicity of the find operation.
    494  */
    495 RTEMS_INLINE_ROUTINE rtems_rbtree_control *rtems_rbtree_find_header(
    496   rtems_rbtree_node *the_node
    497 )
    498 {
    499   return _RBTree_Find_header( the_node );
    500 }
    501 
    502 /**
    503410 * @copydoc _RBTree_Insert_unprotected()
    504411 */
     
    511418}
    512419
    513 /**
    514  * @brief Insert a node on a rbtree.
    515  *
    516  * This routine inserts @a the_node on @a the_rbtree.
    517  * It disables interrupts to ensure the atomicity of the insert operation.
    518  *
    519  * @retval 0 Successfully inserted.
    520  * @retval -1 NULL @a the_node.
    521  * @retval RBTree_Node* if one with equal key to the key of @a the_node exists
    522  *         in an unique @a the_rbtree.
    523  */
    524 RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_insert(
    525   rtems_rbtree_control *the_rbtree,
    526   rtems_rbtree_node *the_node
    527 )
    528 {
    529   return _RBTree_Insert( the_rbtree, the_node );
    530 }
    531 
    532420/**
    533421 * @brief Determines whether the tree is unique.
Note: See TracChangeset for help on using the changeset viewer.