Beispiel #1
0
        public void CheckFriend(object id)
        {
            var friendlist = VkWebRequest.GetFriends((Int32)id);

            foreach (var newFriend in friendlist)
            {
                Add(newFriend, (Int32)id);
            }
            locker.WaitOne();
            //threads += 1;
            locker.ReleaseMutex();
        }
Beispiel #2
0
        public void CheckFriend(object id)
        {
            var friendlist = VkWebRequest.GetFriends((Int32)id);

            foreach (var newFriend in friendlist)
            {
                Add(newFriend, (Int32)id);
                if (SetControl.SetControler.Intersect(newFriend, ThreadId))
                {
                    mutex.WaitOne();
                    if (!Intersection)
                    {
                        Intersection = true;
                        intersect    = newFriend;
                    }
                    mutex.ReleaseMutex();
                    return;
                }
            }
        }
Beispiel #3
0
        public async void CheckFriendAsync(object id)
        {
            var friendlist = await TaskManager <List <ItemInfo> > .RunTask(() => VkWebRequest.GetFriends((Int32)id));

            TaskManager <List <ItemInfo> > .ReleaseTask();

            foreach (var newFriend in friendlist)
            {
                Add(newFriend, (Int32)id);
                if (SetControl.SetControler.Intersect(newFriend, ThreadId) || Intersection)
                {
                    mutex.WaitOne();
                    if (!Intersection)
                    {
                        Intersection = true;
                        intersect    = newFriend;
                    }
                    mutex.ReleaseMutex();
                    await Task.Yield();
                }
            }
        }