We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 23cbc0c + adce85f commit 01881bdCopy full SHA for 01881bd
src/critnib/critnib.c
@@ -525,7 +525,9 @@ find_predecessor(struct critnib_node *__restrict n) {
525
while (1) {
526
int nib;
527
for (nib = NIB; nib >= 0; nib--) {
528
- if (n->child[nib]) {
+ struct critnib_node *m;
529
+ utils_atomic_load_acquire_ptr((void **)&n->child[nib], (void **)&m);
530
+ if (m) {
531
break;
532
}
533
@@ -534,7 +536,7 @@ find_predecessor(struct critnib_node *__restrict n) {
534
536
return NULL;
535
537
538
- n = n->child[nib];
539
+ utils_atomic_load_acquire_ptr((void **)&n->child[nib], (void **)&n);
540
if (is_leaf(n)) {
541
return to_leaf(n);
542
0 commit comments