Exemplo n.º 1
0
 internal static void PushActorRefToStack(LocalActorRef actorRef)
 {
     InterlockedSpin.Swap(ref _stack, st =>
                          st == null
                                 ? ImmutableStack.Create(actorRef)
                                 : st.Push(actorRef));
 }
Exemplo n.º 2
0
 internal static void PopActorAndMarkerFromStack()
 {
     InterlockedSpin.Swap(ref _stack, st =>
                          st == null
                                 ? null
                                 : st.Peek() == null       // if first item is null, i.e. a marker
                                         ? st.Pop().Pop()  // then pop that value,
                                         : st.Pop());      // otherwise pop only the actor
 }
Exemplo n.º 3
0
 public static void Clear_ForTestingONLY()
 {
     InterlockedSpin.Swap(ref _stack, st => st.Clear());
     InterlockedSpin.Swap(ref _stack, st => st.Clear());
 }
Exemplo n.º 4
0
        private void UpdateChildrenCollection(Func <ChildrenCollection, ChildrenCollection> updater)
        {
#pragma warning disable 420             //Ok to disregard from CS0420 "a reference to a volatile field will not be treated as volatile" as we're using interlocked underneath, see http://msdn.microsoft.com/en-us/library/4bw5ewxy.aspx
            InterlockedSpin.Swap(ref _childrenDoNotCallMeDirectly, updater);
#pragma warning restore 420
        }