Module: xenomai-3
Branch: stable-3.0.x
Commit: c23b72e6c67eaf5f9b31eb79e631f38c08f00109
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=c23b72e6c67eaf5f9b31eb79e631f38c08f00109

Author: Philippe Gerum <r...@xenomai.org>
Date:   Mon Jan 18 12:50:04 2016 +0100

alchemy/queue: disable buffer-to-buffer transfer in broadcast mode

---

 lib/alchemy/queue.c |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/lib/alchemy/queue.c b/lib/alchemy/queue.c
index 04e86c6..410f480 100644
--- a/lib/alchemy/queue.c
+++ b/lib/alchemy/queue.c
@@ -594,11 +594,11 @@ out:
  * ensuring a FIFO ordering.
  *
  * - Q_BROADCAST causes the message to be sent to all tasks currently
- * waiting for messages. The message is not copied; a reference count
- * is maintained instead so that the message will remain valid until
- * the last receiver releases its own reference using rt_queue_free(),
- * after which the message space will be returned to the queue's
- * internal pool.
+ * waiting for messages. The message is not copied multiple times; a
+ * reference count is maintained instead so that the message will
+ * remain valid until the last receiver releases its own reference
+ * using rt_queue_free(), after which the message space will be
+ * returned to the queue's internal pool.
  *
  * @return Upon success, this service returns the number of receivers
  * which got awaken as a result of the operation. If zero is returned,
@@ -642,6 +642,10 @@ int rt_queue_write(RT_QUEUE *queue,
        if (qcb == NULL)
                goto out;
 
+       if (mode & Q_BROADCAST)
+               /* No buffer-to-buffer copy in broadcast mode. */
+               goto enqueue;
+
        waiter = syncobj_peek_grant(&qcb->sobj);
        if (waiter && threadobj_local_p(waiter)) {
                /*


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://xenomai.org/mailman/listinfo/xenomai-git

Reply via email to