Skip to content

Conversation

@Omzee15
Copy link

@Omzee15 Omzee15 commented Nov 16, 2025

  • Added threading.Lock to prevent race conditions during instance creation
  • Implemented double-checked locking pattern for optimal performance
  • Updated docstring to reflect thread-safety guarantee
  • Removed TODO comment as the issue is now resolved

This fix ensures that the singleton pattern works correctly in parallel execution contexts, preventing potential issues where multiple threads could create multiple instances simultaneously.

- Added threading.Lock to prevent race conditions during instance creation
- Implemented double-checked locking pattern for optimal performance
- Updated docstring to reflect thread-safety guarantee
- Removed TODO comment as the issue is now resolved

This fix ensures that the singleton pattern works correctly in parallel
execution contexts, preventing potential issues where multiple threads
could create multiple instances simultaneously.
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