public void ReleaseHandle () { int lh; lock (this) { liveHandles--; lh = liveHandles; } if (unusedHandles == 0 && lh == 0) { UnloadDomain (); } }