title: How to observe the list from two thread to updata data?
body: <p>I want to test the "WaitOne", and now the conclude is correct if not display the UI, When it display the list of UI ,it's incorrect. I know that why problem on display, but I don't Know how to fix it.  </p>
  
  <p>When thd01 use "Application.DoEvents()", thd02 can work,but I need thread  go back thd01 continue work. </p>
  
  <p>Who can tell me, how to solve this problem?</p>
  
  <pre><code>private void btn_Base_Click(object sender, EventArgs e)
  {
      Thread thd01 = new Thread(new ThreadStart(Base_thd1));
      Thread thd02 = new Thread(new ThreadStart(Base_thd2));
  
      thd01.Start();
      thd02.Start();
  } 
  private void Base_thd1()
  {
      if (list_Base.InvokeRequired)
      {
          BeginInvoke(new OnUpdateListInvokeDelegate1(Base_thd1));
      }
      else
      {
          list_Base.Items.Add("Start thd1");
  
          Application.DoEvents();  
          list_Base.Items.Add("thd1 Sleep");
          Thread.Sleep(3000);
          list_Base.Items.Add("End thd1");
  
          list_Base.Items.Add("Set ");
          mre.Set();
      }
  }
  
  private void Base_thd2()
  {
      if (list_Base.InvokeRequired)
      {
          BeginInvoke(new OnUpdateListInvokeDelegate1(Base_thd2));
      }
      else
      {
          list_Base.Items.Add("Start thd2");
          list_Base.Items.Add("thd2 Wait...");
  
          mre.WaitOne()
  
          list_Base.Items.Add("End thd2");
  }
  </code></pre>
  
  <p>I create two thread to test <code>WaitHandle.waitone</code>, 
  if I don't display the UI, the correct conclude is like this.</p>
  
  <p>Start thd1
  thd1 sleep
  Start thd2
  thd2 Wait...
  End thd1
  thd1 Set
  End thd2</p>
  
  <p>When thd1 is sleep, the thd2 process keep run until <code>WaitOne</code>. 
  And then thd1 wake up , 
  it communicate the thd2, allow thd2 process continue to run.</p>
  
  <p>It's difference if I wan to display the list of UI.It need to consider main Thread.</p>
  
  <p>First I call main thread , let thd1 can display list of UI ,But it need break point,So I think use 'Application.DoEvents()' let thd2 keep running when thd1 sleep, it's work. </p>
  
  <p>But it can't return thd1.</p>
  
  <p>flow chart:
     <code>thd1   -&gt;(OK)    thd2      -&gt;(How to do.)       thd1</code></p>