I am not sure I understand the last few lines. Isn't the try/finally block going to just release the lock as soon as we grab it? Not sure what purpose this serves. Was this supposed to be a lock to unregister the server?