Skip to content

Refactored WebSocketImpl to fix thread-safety#2432

Draft
snej wants to merge 2 commits intomasterfrom
fix/threadsafe-websocketimpl
Draft

Refactored WebSocketImpl to fix thread-safety#2432
snej wants to merge 2 commits intomasterfrom
fix/threadsafe-websocketimpl

Conversation

@snej
Copy link
Copy Markdown
Collaborator

@snej snej commented Feb 5, 2026

No description provided.

@cbl-bot
Copy link
Copy Markdown

cbl-bot commented Feb 5, 2026

Code Coverage Results:

Type Percentage
branches 64.53
functions 77.31
instantiations 70.94
lines 75.84
regions 72.13

@snej snej force-pushed the fix/threadsafe-websocketimpl branch from 5c4fd27 to 15239f2 Compare February 17, 2026 17:27
@snej snej force-pushed the fix/threadsafe-websocketimpl branch from 15239f2 to 07fbbe3 Compare February 17, 2026 17:29
WebSocketImpl has several methods that are called with the mutex
locked, but have to call external code that can call back in and
deadlock. The current code has some awkward special-purpose
mechanisms to defer those calls until the outer method releases the
lock.
I haven't figured out the best way to do this, but I added a small
utility class that allows for queuing up lambdas that will be called
later after the mutex unlocks.
@snej snej force-pushed the fix/threadsafe-websocketimpl branch from 07fbbe3 to 1aa40ba Compare February 17, 2026 17:54
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.

2 participants