title: C# threading problem
body: <p>i have main thread (MainThread) on which I create new thred (lets call it NewThread). In NewThread I call a method that want to invoke some method for MainThread. </p>
  
  <p>The problem is that when I call NewThread.Join() from MainThread, Invoke method from NewThread cant be accomplished/terminate (and whole application freeze for ever...) because MainThread is waiting for NewThread to terminate...</p>
  
  <p>sth like vicious circle... Any ideas how to solve it? I need to have possibility to terminate/abort NewThread from MainThread and be shure NewThread no longer exist. </p>
  
  <p>I hope I was specific enough. </p>
  
  <p>Main thread:</p>
  
  <pre><code>void method()
      {
          if(currentthread!=null)
          {
              currentthread.Join();
              currentthread=null;
          }
  
          sth...
  
          Backgroundworker worker = new Backgroundworker();
          worker.DoWork += delegate (...)
              {
                  currentthread=Thread.CurrentThread;
                  Func();
              }
              ....
  }
  </code></pre>
  
  <p>NewThread:</p>
  
  <pre><code>delegate void FuncDel();
  void Func()
  {
  
      if(MainThread.InvokeRequired)
  {
      FuncDel funcD = new FuncDel();
      MainThread.InvokeRequired(funcD);
            return;
  } 
   ....
  }
  </code></pre>