Preserve ignored error snapshots
This commit is contained in:
@@ -14,11 +14,12 @@ 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.** `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.
|
||||
* **Per-thread state.** `IGNORE` copies the swallowed context into its
|
||||
thread-local `__akerr_last_ignored` snapshot before releasing the pool slot.
|
||||
The snapshot remains valid until that thread ignores another error, so a
|
||||
later pool checkout cannot overwrite it. The snapshot 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