Esempio n. 1
0
        internal override bool Arrive()
        {
            bool arrivedAtParent = false;
            int  x;

            do
            {
                x = count;
                if (x == 0 && !arrivedAtParent)
                {
                    if (parent.Arrive())
                    {
                        arrivedAtParent = true;
                    }
                    else
                    {
                        return(false);
                    }
                }
            } while (Interlocked.CompareExchange(ref count, x + 1, x) != x);

            if (arrivedAtParent && x != 0)
            {
                parent.Depart();
            }

            return(true);
        }
Esempio n. 2
0
		public bool Depart (CSnziNode node)
		{
			return node.Depart ();
		}
Esempio n. 3
0
 public bool Depart(CSnziNode node)
 {
     return(node.Depart());
 }