u/periander - 2 Archived Voat Posts in v/programming
u/periander
  • home
  • search

u/periander

1 post · 1 comment · 2 total

Active in: v/programming (2)

  • ‹‹‹
  • ‹‹
  • ‹
  • 1
  • ›
  • ››
  • ›››
Comment on: C# BackgroundWorker & ManualResetEvent

Ok, so the WaitOne is blocking the RunWorkerCompleted from triggering. Have to Set the ManualResetEvent at the end of DoWork.

var bgw = new BackgroundWorker();
var mre = new ManualResetEvent(false);
bgw.DoWork += (s, a) => { Thread.Sleep(1000); mre.Set(); };
bgw.RunWorkerCompleted += (s, a) => { };
bgw.RunWorkerAsync();
mre.WaitOne();
0 18 Jun 2015 06:13 u/periander in v/programming
C# BackgroundWorker & ManualResetEvent
2 1 comment 17 Jun 2015 07:07 u/periander (self.programming) in v/programming
  • ‹‹‹
  • ‹‹
  • ‹
  • 1
  • ›
  • ››
  • ›››

archive has 9,592 posts and 65,719 comments. source code.