Skip to content

[MessageControl] Do not create a worker thread in DirectOutput#385

Merged
VeithMetro merged 2 commits into
masterfrom
development/message-control-worker-pointer
Jul 1, 2026
Merged

[MessageControl] Do not create a worker thread in DirectOutput#385
VeithMetro merged 2 commits into
masterfrom
development/message-control-worker-pointer

Conversation

@VeithMetro

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the MessageControl plugin to avoid creating (and managing) a worker thread when running in “DirectOutput” mode where no messaging data buffer exists.

Changes:

  • Make the WorkerThread optional by storing it as a pointer and guarding usage with null checks.
  • Conditionally create the worker thread only when Messaging::MessageUnit::Instance().DataSize() != 0.
  • Update shutdown and callback handling to account for the optional worker thread.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
MessageControl/MessageControl.h Switches _worker to an optional pointer and adds null-guarded lifecycle/callback logic.
MessageControl/MessageControl.cpp Initializes _worker to null and conditionally allocates it based on DataSize().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread MessageControl/MessageControl.h Outdated
Comment thread MessageControl/MessageControl.cpp Outdated
@VeithMetro VeithMetro requested a review from sebaszm June 30, 2026 09:46
@VeithMetro VeithMetro merged commit 77d3bc0 into master Jul 1, 2026
36 of 40 checks passed
@VeithMetro VeithMetro deleted the development/message-control-worker-pointer branch July 1, 2026 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants