示例#1
0
        private bool WaitForCandidates()
        {
            int waitingLoops = 0;

            System.Diagnostics.Debug.WriteLine("user in wait for candidates: " + userName);
            while (ActiveUsersList <NeatGenome> .IsUserWaitingForVideos(userName))
            {
                System.Threading.Thread.Sleep(100);
                ++waitingLoops;
                // Remember: each loop takes about 0.1 seconds (see Thread.Sleep just above)
                if (waitingLoops > 350)
                {
                    System.Diagnostics.Debug.WriteLine("Waiting forcandidates to be ready timed out!");
                    return(false);
                }
            }
            return(true);
        }