Chào mọi người hôm nay mình cần mọi người hỗ trợ giúp mình 1 vấn đề này với ạ
Mình viết 1 chương trình check sock live hoặc die, đây là giao diện chương trình

khi check thì thread sẽ lặp hết từ trên xuống nhưng có vấn đề lâu lâu 1 line socks sẽ bị lặp lại nhiều lần và nếu live sẽ hiện như này

Live || 166.62.63.147:61432
Live || 166.62.63.147:61432
Live || 166.62.63.147:61432
Live || 166.62.63.147:61432
đây là code của mình
Mã:
public partial class Form1 : Form
    {
        bool continueThreads = false;
        int ptr = 0;
        string[] list = null;
        List<Thread> threadList = new List<Thread>();
        int finished = 0;
private void button1_Click(object sender, EventArgs e)
        {
            int n = (int)numericUpDown1.Value;
            Thread[] tl = new Thread[n + 1];
            threadList = tl.ToList();
            for (int i = 0; i <= n; i++)
            {
                threadList[i] = new Thread(new ThreadStart(getlist));
            }
            for (int i = 0; i <= n; i++)
            {
                threadList[i].Start();
            }
            richTextBox2.Text = "";
            ptr = 0;
            finished = 0;
            continueThreads = true;
            proxyList = richTextBox1.Lines;
        }
        public void getlist()
        {
            //MessageBox.Show(list.Length.ToString());
            while (continueThreads)
            {
                if (ptr < list.Length)
                {
                    string info = "";
                    dynamic p = proxyList[ptr].Split(':');
                    ptr += 1;
                    //code check socks {}
                    info += "Live || " + p[0] + ":" + p[1];
                    this.Invoke(new Action(() => richTextBox2.Text += info));
                }
                else
                {
                    continueThreads = false;
                    break;
                }
            }
        }