public Handle GetHandle () { lock (this) { if (unusedHandles <= 0) { throw new InvalidOperationException ("No handles left"); } unusedHandles--; liveHandles++; } return new Handle (this); }