Assets/Plugins/Unity.Media.Utilities/Runtime/AtomicQueue.cs
/// <summary>
/// Add an element to the queue
/// </summary>
/// <param name="payload">A pointer to the element to be added</param>
Add an element to the queue
Add an element to the queue
public void Enqueue(T* payload)
        {
            var node = (long) Acquire((long) payload, 0);
            AtomicNode* root = AcquireRoot();
            var last = (AtomicNode*) root->Payload;
            root->Payload = node;
            if (last != null)
                last->Next = node;
            if (root->Next == 0)
                root->Next = node;
            ReleaseRoot(root);
        }
public void Enqueue ( T * payload ) { var node = ( long ) Acquire ( ( long ) payload , 0 ) ; AtomicNode * root = AcquireRoot ( ) ; var last = ( AtomicNode * ) root -> Payload ; root -> Payload = node ; if ( last != null ) last -> Next = node ; if ( root -> Next == 0 ) root -> Next = node ; ReleaseRoot ( root ) ; }
Add an element to the queue
Add an element to the queue
// Queue was empty
payload
T*
A pointer to the element to be added
A pointer to the element to be added