<sys/mutex.h> rather than <sys/lock.h>. Conditionally include the appropriate file so this compiles again.