Implement state lock to be used by kernel creators.