public class CountDownRaceRunner extends Object
| 修飾子とタイプ | フィールドと説明 |
|---|---|
protected int |
_countOfEntry |
protected int |
_entryNumber |
protected Object |
_lockObj |
protected CountDownRaceLatch |
_ourLatch |
protected long |
_threadId |
| コンストラクタと説明 |
|---|
CountDownRaceRunner(long threadId,
CountDownRaceLatch ourLatch,
int entryNumber,
Object lockObj,
int countOfEntry) |
| 修飾子とタイプ | メソッドと説明 |
|---|---|
protected void |
checkEntryNumber(int entryNumber) |
int |
getEntryNumber()
Get the entry number of the car (current thread).
|
Object |
getLockObj()
Get the lock object to handle threads as you like it.
|
CountDownRaceLatch |
getOurLatch()
Get the our latch to handle the threads.
|
long |
getThreadId()
Get the thread ID of the car (current thread).
|
boolean |
isEntryNumber(int entryNumber)
Is this car same as the specified entry number?
|
void |
restart()
All runners restart from here.
|
void |
teaBreak(long millis) |
protected final long _threadId
protected final CountDownRaceLatch _ourLatch
protected final int _entryNumber
protected final Object _lockObj
protected final int _countOfEntry
public CountDownRaceRunner(long threadId,
CountDownRaceLatch ourLatch,
int entryNumber,
Object lockObj,
int countOfEntry)
public void teaBreak(long millis)
public void restart()
new CountDownRace(3).readyGo(new CountDownRaceExecution() {
public void execute(CountDownRaceRunner runner) {
...
// all runners stop and wait for other cars coming here
runner.restart();
...
}
});
public boolean isEntryNumber(int entryNumber)
entryNumber - The entry number to compare.protected void checkEntryNumber(int entryNumber)
public long getThreadId()
public CountDownRaceLatch getOurLatch()
public int getEntryNumber()
public Object getLockObj()
Copyright © 2014–2015 The DBFlute Project. All rights reserved.