Use locks to coordinate among wait(), launch(), &c