if (Monitor.TryEnter(sync)) try { return DoSomething(); } finally { Monitor.Exit(sync) } return null;