Fix locking interface in defs.h