mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-07-24 15:27:41 +08:00
refactor(uORB): drop redundant lock around the atomic _advertised store
DeviceNode::open() took the cdev lock only to call mark_as_advertised(), but _advertised is a px4::atomic, so the single store needs no lock. (Suggested in review.)
This commit is contained in:
@@ -76,9 +76,8 @@ uORB::DeviceNode::open(cdev::file_t *filp)
|
||||
/* is this a publisher? */
|
||||
if (filp->f_oflags == PX4_F_WRONLY) {
|
||||
|
||||
lock();
|
||||
// _advertised is atomic, so no lock is needed around this single store
|
||||
mark_as_advertised();
|
||||
unlock();
|
||||
|
||||
/* now complete the open */
|
||||
return CDev::open(filp);
|
||||
|
||||
Reference in New Issue
Block a user