Release ignored error contexts
Some checks are pending
libakerror CI Build / mutation_test (push) Waiting to run
libakerror CI Build / cmake_build (push) Successful in 2m52s
libakerror CI Build / coverage (push) Successful in 2m53s

This commit is contained in:
2026-08-03 12:55:42 -04:00
committed by Logikoma
parent fdb8ffaad0
commit 4fe7571329
4 changed files with 21 additions and 27 deletions

View File

@@ -14,9 +14,11 @@ What that covers:
against each other and against lookups. Two threads reserving the same range
cannot both win — exactly one gets `NULL` and the other gets
`AKERR_STATUS_RANGE_OVERLAP` naming the winner.
* **Per-thread state.** The context behind `IGNORE` (`__akerr_last_ignored`) and
the last-ditch context used to report `akerr_release_error(NULL)` are
thread-local, so one thread's ignored error is never another's.
* **Per-thread state.** `IGNORE` uses `__akerr_last_ignored` as a scratch pointer
while it logs an error, then releases the context and clears the pointer.
That scratch pointer and the last-ditch context used to report
`akerr_release_error(NULL)` are thread-local, so concurrent calls cannot
overwrite each other's state.
* **Handing a context from one thread to another.** A context is not thread
state — it lives in `AKERR_ARRAY_ERROR`, which is process-global — so it
outlives the thread that raised it. The reference count is the only field the