private class LockTest.FirstExclusiveUser extends LockTest.LockUser
This type of thread takes a lock, and then waits for some amount of time. This should be enough time for the second thread to try to take the lock. If the second thread does not block, and succeeds in taking the lock while the first thread is sleeping, the locks were taken simultaneously, and the test fails.
Constructor and Description |
---|
FirstExclusiveUser(Path path,
boolean exclusive)
Creates the thread object.
|
Modifier and Type | Method and Description |
---|---|
protected void |
locked()
Notifies the second thread that it should try to take the lock, and
then waits.
|
released, run, started
FirstExclusiveUser(Path path, boolean exclusive)
path
- Path to be locked by this thread.exclusive
- Whether or not the path is to be locked for
exclusive access.protected void locked()
locked
in class LockTest.LockUser