-
Notifications
You must be signed in to change notification settings - Fork 391
Put ImR_Activator_ORB_Runner into its own file, use make_unique, fix C++23 warnings #2422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
aed671c
Put ImR_Activator_ORB_Runner into its own file, use make_unique
jwillemsen 3375743
Use default/override
jwillemsen 1882aa4
Removed volatile, causes warnings with C++23
jwillemsen 2687d6b
Removed volatile, causes warnings with C++23
jwillemsen cff6fe2
Add missing end newline
jwillemsen a89e148
Update Activator_ORB_Runner.cpp
jwillemsen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #include "Activator_ORB_Runner.h" | ||
| #include "Activator_Loader.h" | ||
|
|
||
| ImR_Activator_ORB_Runner::ImR_Activator_ORB_Runner (ImR_Activator_Loader& service) | ||
| : service_ (service) | ||
| { | ||
| } | ||
|
|
||
| int | ||
| ImR_Activator_ORB_Runner::svc () | ||
| { | ||
| // Block until service_.fini() calls orb->destroy() | ||
| this->service_.run (); | ||
| return 0; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| // -*- C++ -*- | ||
| #ifndef TAO_IMR_ACTIVATOR_ORB_RUNNER_H | ||
| #define TAO_IMR_ACTIVATOR_ORB_RUNNER_H | ||
|
|
||
| #include "ace/Task.h" | ||
|
|
||
| #if !defined (ACE_LACKS_PRAGMA_ONCE) | ||
| # pragma once | ||
| #endif /* ACE_LACKS_PRAGMA_ONCE */ | ||
|
|
||
| class ImR_Activator_Loader; | ||
|
|
||
| class ImR_Activator_ORB_Runner : public ACE_Task_Base | ||
| { | ||
| public: | ||
| ImR_Activator_ORB_Runner (ImR_Activator_Loader& service); | ||
| ~ImR_Activator_ORB_Runner () = default; | ||
|
|
||
| int svc () override; | ||
| private: | ||
| ImR_Activator_Loader& service_; | ||
| }; | ||
|
|
||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Verify thread safety after removing
volatilequalifier.The removal of
volatilefrom these member variables could introduce race conditions if they're accessed from multiple threads without proper synchronization. Whilevolatileis often misused for thread synchronization, its removal needs careful verification.Since this is multi-threaded code (MT prefix) and the variables are public, ensure that:
request_reply_count_mutex_nrequests()andnreplies()methods provide thread-safe access🏁 Script executed:
Length of output: 5908
Ensure all reads and writes of
nrequests_/nreplies_are synchronizedThe current implementation protects increments with
request_reply_count_mutex_, but:Chatter::nrequests()andChatter::nreplies()return the raw fields without locking.client.cpp, there’s a direct read of the public members (worker2.nrequests_,worker2.nreplies_) bypassing any mutex.These gaps can lead to data races. Please address the following:
• Guard the accessors with the same mutex:
• Replace any direct member access in
client.cppwith the thread-safe accessors:• (Optional) Make
nrequests_andnreplies_private inchatter.hto prevent accidental direct access.Implementing these changes will eliminate potential race conditions when reading or writing the counters.
🤖 Prompt for AI Agents