I have never used this API, someone else might have a better answer!
On completing the Task, the WaitScreen will invoke the commandAction event of it's CommandListener, with either WaitScreen.SUCCESS_COMMAND or WaitScreen.FAILURE_COMMAND as the argument to the Command parameter. You could use this to awaken sleeping threads.
Code:
// somewhere accessible to all
public static Object semaphore = new Object();
Code:
// in each thread that must wait
synchronized (semaphore) {
boolean woken = false;
while (!woken) {
try {
// go to sleep, until we're woken up
semaphore.wait();
woken = true;
} catch (InterruptedException ie) {
// "woken" remains false
}
}
}
Code:
// in the WaitScreen's CommandListener
public void commandAction(Command c, Displayable d) {
// you can check "d" to determine which WaitScreen just finished
// you can check "c" to determine success or failure
synchronize (semaphore) {
// wake up all waiting threads
semaphore.notifyAll();
}
}
Does that help?
Graham.