fix double-load in radbin conversion path; fix incorrect mutation of potentially-nil trees when snapping to a file without a specific line; fix di_close path when work is occurring

This commit is contained in:
Ryan Fleury
2025-06-18 09:56:47 -07:00
parent 401f117653
commit bee2570d39
6 changed files with 18 additions and 21 deletions
+3 -3
View File
@@ -531,7 +531,6 @@ di_close(DI_Key *key)
DI_Slot *slot = &di_shared->slots[slot_idx];
DI_Stripe *stripe = &di_shared->stripes[stripe_idx];
log_infof("close_debug_info: {\"%S\", 0x%I64x}\n", key_normalized.path, key_normalized.min_timestamp);
B32 closed = 0;
OS_MutexScopeW(stripe->rw_mutex)
{
//- rjf: find existing node
@@ -544,7 +543,8 @@ di_close(DI_Key *key)
if(node->ref_count == 0) for(;;)
{
//- rjf: release
if(ins_atomic_u64_eval(&node->touch_count) == 0)
if(ins_atomic_u64_eval(&node->touch_count) == 0 &&
ins_atomic_u64_eval(&node->is_working) == 0)
{
di_string_release__stripe_mutex_w_guarded(stripe, node->key.path);
if(node->file_base != 0)
@@ -568,7 +568,7 @@ di_close(DI_Key *key)
break;
}
//- rjf: wait for touch count to go to 0
//- rjf: wait for touch count / working marker to go to 0
os_condition_variable_wait_rw_w(stripe->cv, stripe->rw_mutex, max_U64);
}
}