From: ronag Date: Sat, 5 Nov 2011 14:45:05 +0000 (+0000) Subject: (no commit message) X-Git-Tag: dependencies_subtree~10 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=277696c4bf2045442baba4a1d343e3f073eb647e;p=casparcg --- diff --git a/concrt_extras/agents_extras.h b/concrt_extras/agents_extras.h index f49b45a1e..74f7c44ea 100644 --- a/concrt_extras/agents_extras.h +++ b/concrt_extras/agents_extras.h @@ -1181,11 +1181,11 @@ namespace Concurrency /// /// A pointer to a new message. /// - virtual void propagate_to_any_targets(message<_Type> * _PMessage) + virtual void propagate_to_any_targets(message<_Type> * _PMessage) { // Enqueue pMessage to the internal message buffer if it is non-NULL. // pMessage can be NULL if this LWT was the result of a Repropagate call - // out of a Consume or Release (where no new message is queued up, but + // out of a Consume or Release (where no new message is queued up, but // everything remaining in the bounded buffer needs to be propagated out) if (_PMessage != NULL) { @@ -1194,13 +1194,16 @@ namespace Concurrency // If the incoming pMessage is not the head message, we can safely assume that // the head message is blocked and waiting on Consume(), Release() or a new // link_target() and cannot be propagated out. - if (_M_messageBuffer.is_head(_PMessage->msg_id())) + if (!_M_messageBuffer.is_head(_PMessage->msg_id())) { - _Propagate_priority_order(); + return; } } - else + + _Propagate_priority_order(); + { + // While current size is less than capacity try to consume // any previously offered ids. bool _ConsumedMsg = true;