I'm wondering if we should give this particular lock a memorable/unambiguous name-- there will be various kinds of locks, mutexs, etc throughout the system, so down the road, check_lock might not be as clear as it is today.
Maybe, @check_instance_lock, or @check_state_lock. Just a thought.
Overall lgtm. A few small comments:
> + if(admin or not locked):
No parens needed :-)
> + @checks_lock
I'm wondering if we should give this particular lock a memorable/ unambiguous name-- there will be various kinds of locks, mutexs, etc throughout the system, so down the road, check_lock might not be as clear as it is today.
Maybe, @check_ instance_ lock, or @check_state_lock. Just a thought.