// The release operation public void Release(ReleaseArgs releaseArgs) { lock (monitor) { UpdateStateOnRelease(releaseArgs); Monitor.PulseAll(monitor); /* or Monitor.Pulse if only one thread can have success in its acquire */ } }
// generic release operation public void Release(ReleaseArgs releaseArgs) { lock (monitor) { UpdateStateOnRelease(releaseArgs); PerformPossibleAcquires(); } }
public DMDConfig() { DebugArgs.Reset(); ReleaseArgs.Reset(); ASTCache.FinishedParsing += parsedSources; ASTCache.FinishedUfcsCaching += new Action(ASTCache_FinishedUfcsCaching); }
// generic release operations public void Release(ReleaseArgs releaseArgs) { _lock.Acquire(); try { UpdateStateOnRelease(releaseArgs); PerformPossibleAcquires(); } finally { _lock.Release(); } }
// do the release operation public void Release(ReleaseArgs releaseArgs) { _lock.Acquire(); try { UpdateStateOnRelease(releaseArgs); wakeup all the blocked threads that can have its acquire satisfied with the new value of "syncState"; } finally { _lock.Release(); } }
// update synchronization state due to a release operation private void UpdateStateOnRelease(ReleaseArgs releaseArgs) { update "syncState" according to "releaseArgs"; }
public DMDConfig() { DebugArgs.Reset(); ReleaseArgs.Reset(); }