Add a lock around compiling.