コード例 #1
0
 public void RotateRendezvousServers()
 {
     lock (@lock)
     {
         config.InsertLast(config.RemoveFirst());
     }
 }
コード例 #2
0
 public void RotateRendezvousServers()
 {
     lock (@lock)
     {
         var oldCurrent = config.RemoveFirst();
         oldCurrent.RefreshUri();
         config.InsertLast(oldCurrent);
     }
 }
コード例 #3
0
        private static T Get <T>(HashedLinkedList <T> hashSet)
        {
            var count = hashSet.Count;

            if (count > 0)
            {
                var first = (count > 1) ? hashSet.RemoveFirst() : hashSet.First;
                if (count > 1)
                {
                    hashSet.InsertLast(first);
                }
                return(first);
            }

            return(default(T));
        }