Wrap lock around nailgun spawning to protect against worker threads racing to spawn servers
Review Request #2102 - Created April 21, 2015 and submitted
|Nick Howard (Twitter)|
|benjyw, jsirois, stuhood, zundel|
I'm working on parallelizing some jvm related tasks and I ran into the issue that if multiple threads running NailgunTasks attempt to call runjava around the same time, they may end up spawning multiple nailgun servers. This puts a lock around spawning them so that we can be sure they are only spawned once
CI baking on PR, ran with parallel WIP and saw that no extra servers were spawned.