Some tests need exclusive access to shared resources. With greater use of agentvm mode to support concurrent test execution, the need to support exclusive access is becoming more important.
Proposal
Support an option on @run main
/lock[:name]
Support a commnd line option -lockdir <dir>
By default, /lock will acquire a JVM lock (on an internal object) for the duration of the action. The object will be specific to the name, if a name is given. Otherwise a default name will be assumed.
If -lockdir is specified, /lock wil also get a file lock for a temporary file in the specified directory. This can be used to establish locking between concurrent instances of jtreg.
Proposal
Support an option on @run main
/lock[:name]
Support a commnd line option -lockdir <dir>
By default, /lock will acquire a JVM lock (on an internal object) for the duration of the action. The object will be specific to the name, if a name is given. Otherwise a default name will be assumed.
If -lockdir is specified, /lock wil also get a file lock for a temporary file in the specified directory. This can be used to establish locking between concurrent instances of jtreg.