Skip to content

fix ROSspinThread shutdown data race and prune unloaded instances#361

Open
ahcorde wants to merge 3 commits into
ahcorde/rolling/redundant_instancefrom
ahcorde/rolling/rosspinthread_daterace
Open

fix ROSspinThread shutdown data race and prune unloaded instances#361
ahcorde wants to merge 3 commits into
ahcorde/rolling/redundant_instancefrom
ahcorde/rolling/rosspinthread_daterace

Conversation

@ahcorde

@ahcorde ahcorde commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

fix ROSspinThread shutdown data race and prune unloaded instances

Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
@ahcorde ahcorde self-assigned this Jun 26, 2026
@mergify

mergify Bot commented Jun 26, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Comment thread rqt_gui_cpp/src/rqt_gui_cpp/nodelet_plugin_provider.cpp Outdated
{
if (ros_spin_thread_ != nullptr) {
ros_spin_thread_->abort = true;
ros_spin_thread_->abort.store(true, std::memory_order_relaxed);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

In the title of this PR you suggest that the addition of this line prevents a data race. However, the std::memory_order_relaxed actually adds no guardrails when it comes to compiler optimizations reordering instructions and breaking thread safety.

Why did you choose this in stead of std::memory_order_seq_cst?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

both solution are equivalent in this case.

ahcorde added 2 commits July 10, 2026 15:45
…ce' into ahcorde/rolling/rosspinthread_daterace
Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com>
@ahcorde ahcorde requested a review from asymingt July 10, 2026 14:06
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