Assets/Plugins/Unity.Media.Utilities/Runtime/AtomicQueue.cs
/// <summary>
/// Try to remove an element from the queue.
/// </summary>
/// <param name="result">
/// If there's a element available, this parameter will be updated to 
/// that element.
/// </param>
/// <returns>Whether the dequeueing operation succeeded.</returns>
Try to remove an element from the queue.
Try to remove an element from the queue .
public bool TryDequeue(out T* result)
        {
            result = null;
            AtomicNode* root = AcquireRoot();
            var first = (AtomicNode*)root->Next;
            var dequeued = (first != null);
            if (dequeued)
            {
                result = (T*) first->Payload;
                root->Next = first->Next;
                if (root->Payload == (long) first)
                    root->Payload = 0;
            }
            ReleaseRoot(root);
            if (dequeued)
                FreeList.Release(first);
            return dequeued;
        }
public bool TryDequeue ( out T * result ) { result = null ; AtomicNode * root = AcquireRoot ( ) ; var first = ( AtomicNode * ) root -> Next ; var dequeued = ( first != null ) ; if ( dequeued ) { result = ( T * ) first -> Payload ; root -> Next = first -> Next ; if ( root -> Payload == ( long ) first ) root -> Payload = 0 ; } ReleaseRoot ( root ) ; if ( dequeued ) FreeList . Release ( first ) ; return dequeued ; }
Try to remove an element from the queue.
Try to remove an element from the queue .
// if the first node was also the last node, we need to mark the last pointer as well
Whether the dequeueing operation succeeded.
Whether the dequeueing operation succeeded .
T*
out
result
If there's a element available, this parameter will be updated to
that element.
If there ' s a element available this parameter will be updated to that element .