Skip to content

Locking cleanup#429

Merged
mathieucarbou merged 4 commits intomainfrom
locking
Apr 10, 2026
Merged

Locking cleanup#429
mathieucarbou merged 4 commits intomainfrom
locking

Conversation

@mathieucarbou
Copy link
Copy Markdown
Member

@mathieucarbou mathieucarbou commented Apr 10, 2026

Renamed the _lock variables to a better name to match what they guard exactly.

_queue_lock is a lock guarding the queues and should not be used to guard the internal client pointer.

This is a fix of PR #427 and commit 085f278

…_queue_lock

_queue_lock is a lock guarding the queues and should not be used to guard the internal client pointer
@mathieucarbou mathieucarbou self-assigned this Apr 10, 2026
@mathieucarbou mathieucarbou changed the title Locking clanup Locking cleanup Apr 10, 2026
@mathieucarbou
Copy link
Copy Markdown
Member Author

@MitchBradley FYI

}

void AsyncWebSocketClient::_onTimeout(uint32_t time) {
asyncsrv::lock_guard_type lock(_lock);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed because this is wrong to use the _queue_lock to protect the _client ptr (which is not guarded anywhere else it should be)

}

void AsyncWebSocketClient::_onDisconnect() {
asyncsrv::lock_guard_type lock(_lock);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed because this is wrong to use the _queue_lock to protect the _client ptr (which is not guarded anywhere else it should be)

#endif

IPAddress AsyncWebSocketClient::remoteIP() const {
asyncsrv::lock_guard_type lock(_lock);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed because this is wrong to use the _queue_lock to protect the _client ptr (which is not guarded anywhere else it should be)

}

uint16_t AsyncWebSocketClient::remotePort() const {
asyncsrv::lock_guard_type lock(_lock);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed because this is wrong to use the _queue_lock to protect the _client ptr (which is not guarded anywhere else it should be)

@mathieucarbou mathieucarbou force-pushed the locking branch 2 times, most recently from e4bb562 to 99d9464 Compare April 10, 2026 12:04
@mathieucarbou mathieucarbou merged commit 53c3386 into main Apr 10, 2026
34 checks passed
@mathieucarbou mathieucarbou deleted the locking branch April 10, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant