mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-27 01:50:34 +08:00
perf(uORB): skip poll_notify() on publish without poll waiters
Assisted-by: Claude:claude-fable-5-1
This commit is contained in:
1 parent
427bf69cdd
commit
9d65ba66ae
2 files changed
+14
-2
No files matched your search
@@ -204,10 +204,14 @@ uORB::DeviceNode::write(cdev::file_t *filp, const char *buffer, size_t buflen)
|
||||
/* Mark at least one data has been published */
|
||||
_data_valid = true;
|
||||
|
||||
// Snapshot under the lock: poll() setup registers and self-checks under it too.
|
||||
const bool notify_pollers = has_poll_waiters();
|
||||
|
||||
ATOMIC_LEAVE;
|
||||
|
||||
/* notify any poll waiters */
|
||||
poll_notify(POLLIN);
|
||||
if (notify_pollers) {
|
||||
poll_notify(POLLIN);
|
||||
}
|
||||
|
||||
return _meta->o_size;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user