Switch from boolean to count mode to safely detect disposability in ManualResetEventSlim.
authorJeremie Laval <jeremie.laval@gmail.com>
Thu, 5 Apr 2012 11:16:49 +0000 (12:16 +0100)
committerJeremie Laval <jeremie.laval@gmail.com>
Tue, 10 Apr 2012 11:39:02 +0000 (12:39 +0100)
commitf8b8ea08f6daeeb4ab9e441c018401b5fc45ae49
tree2d00e08f98ecd140356e5512e4cd5ad63f2cb428
parentd878721e31f44af7b60d89c259e63db15982e7dc
Switch from boolean to count mode to safely detect disposability in ManualResetEventSlim.

Having two concurrent operations of Set/Reset who succeeded in fetching the handle before it was disabled all the while trying to dispose may have caused a early release of the handle.
mcs/class/corlib/System.Threading/ManualResetEventSlim.cs