forked from PX4/PX4-Autopilot
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SubscriptionCallback: Add lock protecting callback during its execution
There is a potential problem with sub->call() and sub->[un-]register(), when the callback is executing, if someone drops the callback registration, it will result in a resource leak and a crash. This does not happen in flat mode, as the uORB::DeviceNode::lock protects both, but when a callback thread is used, there is a race condition which is fixed by this patch.
- Loading branch information
Showing
2 changed files
with
39 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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 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