public void InnerNext(InnerSignalObserver <R> sender, R item)
            {
                if (Interlocked.CompareExchange(ref wip, 1, 0) == 0)
                {
                    var q = sender.GetQueue();

                    if (current == sender && (q == null || q.IsEmpty()))
                    {
                        downstream.OnNext(item);
                    }
                    else
                    {
                        if (q == null)
                        {
                            q = sender.CreateQueue(capacityHint);
                        }
                        q.TryOffer(item);
                    }
                    if (Interlocked.Decrement(ref wip) == 0)
                    {
                        return;
                    }
                }
                else
                {
                    var q = sender.GetOrCreateQueue(capacityHint);
                    q.TryOffer(item);
                    if (Interlocked.Increment(ref wip) != 1)
                    {
                        return;
                    }
                }

                DrainLoop();
            }
 public void InnerNext(InnerSignalObserver <R> sender, R item)
 {
     if (Interlocked.CompareExchange(ref wip, 1, 0) == 0)
     {
         var a = Volatile.Read(ref active);
         if (a == sender)
         {
             downstream.OnNext(item);
         }
         if (Interlocked.Decrement(ref wip) == 0)
         {
             return;
         }
     }
     else
     {
         var a = Volatile.Read(ref active);
         if (a == sender)
         {
             var q = sender.GetOrCreateQueue(capacityHint);
             q.TryOffer(item);
             if (Interlocked.Increment(ref wip) != 1)
             {
                 return;
             }
         }
     }
     DrainLoop();
 }