mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-27 21:40:35 +08:00
Added missing lock() unlock() to MuORB
The commented out lock and unlock were determined to be needed and added back. The unit test for VDev was updated. It showed the race between the poll and a write that only does a poll_notify(). Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
@@ -310,8 +310,7 @@ ORBDevNode::read(device::file_t *filp, char *buffer, size_t buflen)
|
||||
/*
|
||||
* Perform an atomic copy & state update
|
||||
*/
|
||||
// FIXME - This used to disable interrupts
|
||||
//lock();
|
||||
lock();
|
||||
|
||||
/* if the caller doesn't want the data, don't give it to them */
|
||||
if (nullptr != buffer)
|
||||
@@ -329,7 +328,7 @@ ORBDevNode::read(device::file_t *filp, char *buffer, size_t buflen)
|
||||
*/
|
||||
sd->update_reported = false;
|
||||
|
||||
//unlock();
|
||||
unlock();
|
||||
|
||||
return _meta->o_size;
|
||||
}
|
||||
@@ -366,7 +365,6 @@ ORBDevNode::write(device::file_t *filp, const char *buffer, size_t buflen)
|
||||
return -EIO;
|
||||
|
||||
/* Perform an atomic copy. */
|
||||
// FIXME - make sure lock is what we want here
|
||||
lock();
|
||||
memcpy(_data, buffer, _meta->o_size);
|
||||
unlock();
|
||||
|
||||
Reference in New Issue
Block a user