forked from Archive/PX4-Autopilot
orb nuttx: fix threadding issue in uORB::DeviceNode::write
same issue as in posix code: 64bit values are not atomic in general.
This commit is contained in:
parent
44012be8b6
commit
c6da90ac63
|
@ -245,17 +245,18 @@ uORB::DeviceNode::write(struct file *filp, const char *buffer, size_t buflen)
|
|||
/* Perform an atomic copy. */
|
||||
irqstate_t flags = irqsave();
|
||||
memcpy(_data, buffer, _meta->o_size);
|
||||
irqrestore(flags);
|
||||
|
||||
/* update the timestamp and generation count */
|
||||
_last_update = hrt_absolute_time();
|
||||
_generation++;
|
||||
|
||||
_published = true;
|
||||
|
||||
irqrestore(flags);
|
||||
|
||||
/* notify any poll waiters */
|
||||
poll_notify(POLLIN);
|
||||
|
||||
_published = true;
|
||||
|
||||
return _meta->o_size;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue