Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ConsumeAndStoreOneMessageIfAvailable()

bool System.Threading.Tasks.Dataflow.BufferBlock< T >.ConsumeAndStoreOneMessageIfAvailable ( )
inlineprivate

Definition at line 296 of file BufferBlock.cs.

297 {
298 while (true)
299 {
300 KeyValuePair<ISourceBlock<T>, DataflowMessageHeader> item;
302 {
304 {
305 return false;
306 }
307 if (!_boundingState.CountIsLessThanBound)
308 {
309 return false;
310 }
311 if (!_boundingState.PostponedMessages.TryPop(out item))
312 {
313 return false;
314 }
315 _boundingState.CurrentCount++;
316 }
317 bool messageConsumed = false;
318 try
319 {
320 T item2 = item.Key.ConsumeMessage(item.Value, this, out messageConsumed);
321 if (messageConsumed)
322 {
324 return true;
325 }
326 }
327 finally
328 {
329 if (!messageConsumed)
330 {
332 {
333 _boundingState.CurrentCount--;
334 }
335 }
336 }
337 }
338 }
readonly BoundingStateWithPostponedAndTask< T > _boundingState

References System.Threading.Tasks.Dataflow.BufferBlock< T >._boundingState, System.Threading.Tasks.Dataflow.BufferBlock< T >._source, System.Threading.Tasks.Dataflow.BufferBlock< T >._targetDecliningPermanently, System.Threading.Tasks.Dataflow.Internal.SourceCore< TOutput >.AddMessage(), System.Threading.Tasks.Dataflow.BufferBlock< T >.IncomingLock, and System.item.

Referenced by System.Threading.Tasks.Dataflow.BufferBlock< T >.ConsumeMessagesLoopCore().