mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-25 00:30:50 +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:
1 parent
6aae566ea1
commit
53b138e38c
1 file changed
+1
-2
@@ -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