uorb: do not open a node exclusively for an advertiser

Exclusive open is not required, but we now need to ensure the queue size
is set atomically.

It avoids a race condition between 2 single-instance advertisers,
where one of them would fail to open the node with -EBUSY.
This commit is contained in:
Beat Küng
2019-11-23 10:10:05 -05:00
committed by Daniel Agar
parent 6c8048d057
commit 86eb91fc18
2 changed files with 9 additions and 35 deletions
-3
View File
@@ -277,9 +277,6 @@ private:
uint8_t _queue_size; /**< maximum number of elements in the queue */
int8_t _subscriber_count{0};
px4_task_t _publisher{0}; /**< if nonzero, current publisher. Only used inside the advertise call.
We allow one publisher to have an open file descriptor at the same time. */
// statistics
uint32_t _lost_messages = 0; /**< nr of lost messages for all subscribers. If two subscribers lose the same
message, it is counted as two. */