Remove unused lock and scope in threading.h Not sure if this is preferred We could also try switching to std::mutex