Skip to content

fix: Share one lock per module for threadsafe resolution - #353

Merged
remimd merged 2 commits into
devfrom
fix/threadsafe-lock
Oct 21, 2026
Merged

remimd merged 2 commits into
devfrom
fix/threadsafe-lock

Conversation

@remimd

@remimd remimd commented Oct 21, 2026

Copy link
Copy Markdown
Member

No description provided.

get_lock created a new lock on each call, so find_instance and
afind_instance never excluded each other, and each @Inject function had
its own lock. A singleton could be created several times despite
threadsafe=True. get_lock can now reuse an existing lock, and each module
passes its own.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@remimd remimd self-assigned this Oct 21, 2026
threading.RLock is a function before Python 3.13, so evaluating
`RLock | None` at import time raised a TypeError.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@remimd
remimd merged commit 18e5226 into dev Oct 21, 2026
9 checks passed
@remimd
remimd deleted the fix/threadsafe-lock branch October 21, 2026 12:21
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