title: backgroundworker not firing RunWorkerCompleted event
body: <p>i have a web application with a search form. The form is being used to search through my own database, but also at other databases through their API service. To provide a fast response, i have decided to split the work in main thread and the backgroundworker service.</p>
  
  <p>Here is my method which runs the search task.</p>
  
  <pre><code>// search through other API
  BackgroundWorker worker = new BackgroundWorker();
  worker.DoWork += new DoWorkEventHandler(worker_DoWork);
  worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(worker_RunWorkerCompleted);
  worker.WorkerSupportsCancellation = true;
  worker.WorkerReportsProgress = true;
  worker.RunWorkerAsync(form);
  
  // search in my api
  ...
  
  // wait for API results
  while (worker.IsBusy) {
      for (sbyte i = 0; i &lt; sbyte.MaxValue; i++) ;
  }
  // handle data and show to user
  </code></pre>
  
  <p>And the methods are</p>
  
  <pre><code>private void worker_DoWork(object sender, DoWorkEventArgs e) {
      Forms f = e.Argument as Forms;
      if (f != null) {
          List&lt;ApiResponse&gt; result = GetDataFromOtherApi(f);
          e.Result = result;
      }
      else e.Result = null;
  }
  </code></pre>
  
  <p>The <code>GetDataFromOtherApi()</code> method works fine in the single thread test. It also works when running the backgroundworker thread. I have set a breakpoint at the end and <code>e.Result</code> has values which i was looking for.</p>
  
  <pre><code>private void worker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) {
      List&lt;ApiResponse&gt; reply = e.Result as List&lt;ApiResponse&gt;;
  
      if (reply == null) ar = null;
      else if (reply.Any()) ar = reply;
      else ar = null;
  }
  </code></pre>
  
  <p>the <code>ar</code> is a variable that the main thread can access to after the while loop has done with running. But, when placing a breakpoint at the start, it never stops there, the loop itself is continuous to the infinity ... It means that the event is never being fired.</p>
  
  <p>Am i missing something ?</p>