File tree 1 file changed +9
-7
lines changed
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 *
523
523
find_predecessor (struct critnib_node * __restrict n ) {
524
524
while (1 ) {
525
525
int nib ;
526
+ struct critnib_node * m ;
526
527
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 ) {
528
530
break ;
529
531
}
530
532
}
@@ -533,9 +535,8 @@ find_predecessor(struct critnib_node *__restrict n) {
533
535
return NULL ;
534
536
}
535
537
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 );
539
540
}
540
541
}
541
542
}
@@ -636,6 +637,8 @@ void *critnib_find_le(struct critnib *c, word key) {
636
637
static struct critnib_leaf * find_successor (struct critnib_node * __restrict n ) {
637
638
while (1 ) {
638
639
unsigned nib ;
640
+ struct critnib_node * m ;
641
+ utils_atomic_load_acquire_ptr ((void * * )& n -> child [nib ], (void * * )& m );
639
642
for (nib = 0 ; nib <= NIB ; nib ++ ) {
640
643
if (n -> child [nib ]) {
641
644
break ;
@@ -646,9 +649,8 @@ static struct critnib_leaf *find_successor(struct critnib_node *__restrict n) {
646
649
return NULL ;
647
650
}
648
651
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 );
652
654
}
653
655
}
654
656
}
You can’t perform that action at this time.
0 commit comments