File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -523,8 +523,10 @@ static struct critnib_leaf *
523523find_predecessor (struct critnib_node * __restrict n ) {
524524 while (1 ) {
525525 int nib ;
526+ struct critnib_node * m = NULL ;
526527 for (nib = NIB ; nib >= 0 ; nib -- ) {
527- if (n -> child [nib ]) {
528+ utils_atomic_load_acquire_ptr ((void * * )& n -> child [nib ], (void * * )& m );
529+ if (m ) {
528530 break ;
529531 }
530532 }
@@ -533,9 +535,8 @@ find_predecessor(struct critnib_node *__restrict n) {
533535 return NULL ;
534536 }
535537
536- n = n -> child [nib ];
537- if (is_leaf (n )) {
538- return to_leaf (n );
538+ if (is_leaf (m )) {
539+ return to_leaf (m );
539540 }
540541 }
541542}
@@ -636,7 +637,9 @@ void *critnib_find_le(struct critnib *c, word key) {
636637static struct critnib_leaf * find_successor (struct critnib_node * __restrict n ) {
637638 while (1 ) {
638639 unsigned nib ;
640+ struct critnib_node * m = NULL ;
639641 for (nib = 0 ; nib <= NIB ; nib ++ ) {
642+ utils_atomic_load_acquire_ptr ((void * * )& n -> child [nib ], (void * * )& m );
640643 if (n -> child [nib ]) {
641644 break ;
642645 }
@@ -646,9 +649,8 @@ static struct critnib_leaf *find_successor(struct critnib_node *__restrict n) {
646649 return NULL ;
647650 }
648651
649- n = n -> child [nib ];
650- if (is_leaf (n )) {
651- return to_leaf (n );
652+ if (is_leaf (m )) {
653+ return to_leaf (m );
652654 }
653655 }
654656}
You can’t perform that action at this time.
0 commit comments