Release ignored error contexts
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user