Assets/Plugins/Unity.Media.Utilities/Runtime/AtomicQueue.cs
/// <summary>
/// Returns the next element from the queue without removing it
/// </summary>
/// <returns>A pointer to the next element from the queue</returns>
/// <exception cref="InvalidOperationException">If the queue is empty</exception>
Returns the next element from the queue without removing it
Returns the next element from the queue without removing it
public T* Peek()
        {
            AtomicNode* root = AcquireRoot();
            bool empty = (root->Next == 0);
            var payload = (T*)(empty ? 0 : ((AtomicNode*)root->Next)->Payload);
            ReleaseRoot(root);
            if (empty)
                throw new InvalidOperationException("Queue is empty");
            return payload;
        }
public T * Peek ( ) { AtomicNode * root = AcquireRoot ( ) ; bool empty = ( root -> Next == 0 ) ; var payload = ( T * ) ( empty ? 0 : ( ( AtomicNode * ) root -> Next ) -> Payload ) ; ReleaseRoot ( root ) ; if ( empty ) throw new InvalidOperationException ( " " ) ; return payload ; }
Returns the next element from the queue without removing it
Returns the next element from the queue without removing it
A pointer to the next element from the queue
A pointer to the next element from the queue
If the queue is empty
If the queue is empty