Roo-Code/src/services
MuriloFP c9be470319 fix: prevent race conditions in McpServerManager singleton initialization
Added thread-safe initialization to the McpServerManager singleton pattern to
prevent potential race conditions when getInstance is called concurrently.
The changes include:

1. Added initializationPromise to track ongoing initialization
2. Implemented double-checked locking pattern:
   - First check: Return existing instance if available
   - Second check: Wait for any ongoing initialization
   - Third check: Double-check inside initialization block
3. Added proper cleanup in finally block to prevent deadlocks

This ensures that:
- Only one McpHub instance is ever created
- Concurrent calls wait for initialization to complete
- Resources are properly initialized and cleaned up
- No memory leaks from incomplete initialization

The fix maintains the existing functionality while making it safe for
concurrent access in VS Code's multi-window environment.
2025-02-07 17:12:39 -03:00
..
browser Prettier backfill 2025-01-17 14:11:28 -05:00
glob Misc refactor cline 2024-10-09 01:49:59 -04:00
mcp fix: prevent race conditions in McpServerManager singleton initialization 2025-02-07 17:12:39 -03:00
ripgrep Chore: Prettier for consistant formatting (#794) 2024-11-21 13:13:54 -08:00
tree-sitter Prettier backfill 2025-01-17 14:11:28 -05:00