[rtems commit] PR2065: RBTree: Insert function (protected) does not enable interrupts

Gedare Bloom gedare at rtems.org
Sun May 13 14:43:17 UTC 2012


Module:    rtems
Branch:    master
Commit:    2b36355b44e004c78872508a28f176fc1b146451
Changeset: http://git.rtems.org/rtems/commit/?id=2b36355b44e004c78872508a28f176fc1b146451

Author:    Gedare Bloom <gedare at rtems.org>
Date:      Sun May 13 10:40:10 2012 -0400

PR2065: RBTree: Insert function (protected) does not enable interrupts

Save the return value from the unprotected version and return it after
enabling interrupts to their previous level.

---

 cpukit/score/src/rbtreeinsert.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/cpukit/score/src/rbtreeinsert.c b/cpukit/score/src/rbtreeinsert.c
index 8789734..57a36b8 100644
--- a/cpukit/score/src/rbtreeinsert.c
+++ b/cpukit/score/src/rbtreeinsert.c
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2010 Gedare Bloom.
+ *  Copyright (c) 2010-2012 Gedare Bloom.
  *
  *  The license and distribution terms for this file may be
  *  found in the file LICENSE in this distribution or at
@@ -148,8 +148,10 @@ RBTree_Node *_RBTree_Insert(
 )
 {
   ISR_Level level;
+  RBTree_Node *return_node;
 
   _ISR_Disable( level );
-    return _RBTree_Insert_unprotected( tree, node );
+  return_node = _RBTree_Insert_unprotected( tree, node );
   _ISR_Enable( level );
+  return return_node;
 }




More information about the vc mailing list