Skip to content

fix: copy registry key before move and fix ThreadPool wait race - #7

Merged
kegouro merged 2 commits into
integration/reconstructionfrom
fix/register-json-order
Jul 4, 2026
Merged

fix: copy registry key before move and fix ThreadPool wait race#7
kegouro merged 2 commits into
integration/reconstructionfrom
fix/register-json-order

Conversation

@kegouro

@kegouro kegouro commented Jul 4, 2026

Copy link
Copy Markdown
Owner
  • Copy the registry key before moving the object in JSON loaders to avoid relying on unspecified function-argument evaluation order.
  • Increment the ThreadPool active counter while holding the queue mutex so waitAll() cannot return while a worker owns an in-flight task.

kegouro and others added 2 commits July 4, 2026 06:41
std::move on the object argument can be evaluated before the id sub-expression, leaving the key empty and causing all JSON entries to overwrite each other. Copy the key explicitly before the move.
The active counter was incremented after popping the task and releasing
the queue mutex. This allowed waitAll() to observe an empty queue and
zero active threads while a worker was about to start a task, causing
runAll() to return and destroy the result mutex before the worker used
it.

Increment active_ under the lock before releasing the task, so
waitAll() only returns when no worker owns an in-flight task.

Co-Authored-By: Claude <noreply@anthropic.com>
@kegouro kegouro changed the title fix(domain): Copy registry key before moving object in JSON loaders fix: copy registry key before move and fix ThreadPool wait race Jul 4, 2026
@kegouro
kegouro merged commit a97f7d5 into integration/reconstruction Jul 4, 2026
7 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant