public synchronized boolean | letMeSleepFor(Sleeper theSleeper, long time)
int index = findNextSlot();
if (index == NOROOM) {
return false;
} else {
sleepers[index] = theSleeper;
sleepFor[index] = time;
new AlarmThread(this, index).start();
return true;
}
|