Skip to content

Commit

Permalink
uORBManager.cpp: Make sure the sub is registered (valid) before invok…
Browse files Browse the repository at this point in the history
…ing cb

There seems to be a race condition where the callback thread is signaled
but the sub is not registered when the orb_callback thread executes.

This patches such errors, but the root cause of the race condition is
not known. Regardless, this sanity check is not wrong.
  • Loading branch information
pussuw committed Oct 9, 2023
1 parent c3a3a83 commit ca7d682
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions platforms/common/uORB/uORBManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,10 @@ uORB::Manager::callback_thread(int argc, char *argv[])
break;
}

if (!sub->registered()) {
continue;
}

sub->call();
}

Expand Down

0 comments on commit ca7d682

Please sign in to comment.