Reading this again, I think this is actually incorrect. If you have two threads coming into the lock you're going to `compile` twice. The `unless` instance should also be checked inside the lock or, better, rewrite `compile` as `@instance ||= new` (I think this won't have side-effects, but I am not sure where else `compile` is called).