CompilerSvc.ICompilerLockManager Interface
- public static interface CompilerSvc.ICompilerLockManager
A project's lock manager allows callers to obtain a read-lock for accessing volatile compiler data. Most calls
directly into compiler features should occur in a lock. Methods that are part of the CompilerSvc generally do
not require locking unless specifically mentioned in that method's documentation.
-
Enclosing class
-
CompilerSvc
acquireReadLock() Method
public void acquireReadLock()
Acquires a read lock for the compiler project. Note that this lock MUST
be released when the client is done with the necessary compiler operations.
invokeInReadLock(Runnable, boolean) Method
public void invokeInReadLock(Runnable
task,
boolean runInForeground)
Invokes the specified task in a compiler read lock. It is recommended that 'runInForeground' be
'false' whenever possible, since it can take quite a while to get a compiler lock in certain
circumstances. Passing 'true' for 'runInForeground' will take the lock, run the runnable,
then release the lock, all on the AWT thread.
Parameters
-
task
- The task to be run within the read lock.
-
runInForeground
- boolean indicating whether the lock and
task should take place on the AWT thread.
releaseReadLock() Method
public void releaseReadLock()
Releases the compiler read lock.