atomic: add extern to lock.