mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-06 13:58:40 +00:00
merge blob & key storage locking scopes in content layer - keep both blob & key cache updates 'atomic'
This commit is contained in:
@@ -188,7 +188,12 @@ c_submit_data(C_Key key, Arena **data_arena, String8 data)
|
|||||||
C_Stripe *stripe = &c_shared->blob_stripes[stripe_idx];
|
C_Stripe *stripe = &c_shared->blob_stripes[stripe_idx];
|
||||||
|
|
||||||
//- rjf: commit data to cache - if already there, just bump key refcount
|
//- rjf: commit data to cache - if already there, just bump key refcount
|
||||||
ProfScope("commit data to cache - if already there, just bump key refcount") MutexScopeW(stripe->rw_mutex)
|
U128 key_expired_hash = {0};
|
||||||
|
ProfScope("commit data to cache - if already there, just bump key refcount")
|
||||||
|
MutexScopeW(stripe->rw_mutex)
|
||||||
|
MutexScopeW(key_stripe->rw_mutex)
|
||||||
|
{
|
||||||
|
//- rjf: commit data to (hash -> data) cache
|
||||||
{
|
{
|
||||||
C_BlobNode *existing_node = 0;
|
C_BlobNode *existing_node = 0;
|
||||||
for(C_BlobNode *n = slot->first; n != 0; n = n->next)
|
for(C_BlobNode *n = slot->first; n != 0; n = n->next)
|
||||||
@@ -234,9 +239,7 @@ c_submit_data(C_Key key, Arena **data_arena, String8 data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//- rjf: commit this hash to key cache
|
//- rjf: commit hash to key cache
|
||||||
U128 key_expired_hash = {0};
|
|
||||||
ProfScope("commit this hash to key cache") MutexScopeW(key_stripe->rw_mutex)
|
|
||||||
{
|
{
|
||||||
// rjf: find existing key
|
// rjf: find existing key
|
||||||
B32 key_is_new = 0;
|
B32 key_is_new = 0;
|
||||||
@@ -310,6 +313,7 @@ c_submit_data(C_Key key, Arena **data_arena, String8 data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//- rjf: decrement key ref count of expired hash
|
//- rjf: decrement key ref count of expired hash
|
||||||
ProfScope("decrement key ref count of expired hash")
|
ProfScope("decrement key ref count of expired hash")
|
||||||
|
|||||||
Reference in New Issue
Block a user