Skip to content

fix: add thread-safe locking to _CUSTOM_CHECKS registry#102

Merged
rororowyourboat merged 1 commit intodevfrom
fix/93-thread-safety-custom-checks
Mar 4, 2026
Merged

fix: add thread-safe locking to _CUSTOM_CHECKS registry#102
rororowyourboat merged 1 commit intodevfrom
fix/93-thread-safety-custom-checks

Conversation

@rororowyourboat
Copy link
Collaborator

Summary

  • Guard _CUSTOM_CHECKS mutations and reads with threading.Lock
  • Return copies from get_custom_checks() and all_checks() to prevent external mutation
  • New concurrent registration test: 20 threads via threading.Barrier

Closes #93

Guard _CUSTOM_CHECKS mutations and reads with threading.Lock to prevent
race conditions in concurrent usage. Return copies from accessors to
prevent external mutation.

Closes #93
@rororowyourboat rororowyourboat merged commit eea5a73 into dev Mar 4, 2026
@rororowyourboat rororowyourboat deleted the fix/93-thread-safety-custom-checks branch March 4, 2026 10:13
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.

fix: mutable global state in _CUSTOM_CHECKS is not thread-safe

1 participant