ManualResetEvent のインスタンスで Set メソッドを呼び出していますが、デッドロックが発生することがあります。ドキュメントには、これがブロッキング メソッドであることを示すものは見つかりません。MRE.Set がブロックされる原因は何ですか?
スタックトレース:
[Managed to Native Transition]
mscorlib.dll!System.Threading.EventWaitHandle.Set() + 0xe bytes
MyCode.StopAll(bool force) Line 179 + 0xd bytes
MyCode.CalcCheckThread() Line 250 + 0xb bytes
mscorlib.dll!System.Threading.ThreadHelper.ThreadStart_Context(object state) + 0x66 bytes
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x6f bytes
mscorlib.dll!System.Threading.ThreadHelper.ThreadStart() + 0x44 bytes
private static void StopAll(bool force)
{
if( !force )
LogHelper.SendAllCloseState(logger);
_forcablyExit = force;
_running = false;
_stopWait.Set(); // This line appears to be blocking
}