cogsmode comment: RAII scoped lock blah blah. 

... or are the scoped locks a boost or C11++ feature we can't use here?