diff --git a/src/PendingCall.cs b/src/PendingCall.cs index 09e5e16..01d097e 100644 --- a/src/PendingCall.cs +++ b/src/PendingCall.cs @@ -39,7 +39,7 @@ public Message Reply conn.DispatchSignals (); } else { if (waitHandle == null) - waitHandle = new ManualResetEvent (false); + Interlocked.CompareExchange (ref waitHandle, new ManualResetEvent (false), null); // TODO: Possible race condition? while (reply == null)