package saker.build.util.config
public class JVMSynchronizationObjects
This class contains singleton instances for controlling synchronized acces to JVM resources.
E.g. if one wants to replace the standard I/O streams, one should get the singleton lock instance and synchronize on if to prevent race conditions.
If one needs multiple locks to acquire to do an operation then one should synchronize on them in alphabetical order. This is in order to avoid deadlocks caused by different locking order. The alphabetical order should be determined by the acquiring method name.
Implementation note: This class uses constant String instances to determine the locks. This is in order to be able to provide a common lock object even if this class has been loaded multiple times by the JVM. See String.intern().
Gets the synchronization lock for accessing the System standard IO streams.
The lock for modifying the standard IO stream.