Threads in a loop

Hello everyone,

Currently am working on a code that runs a thread in a while loop, eg,

while(some condition)

{

Thread bb = new Thread(r);//r is a runnable implementing class

bb.start();

}

What is require is that the loop to stop until the thread completes executing, ie. , the thread dies, after which the loop operation continues and in the next iteration a new thread instance is created and run, is there anyway to do this?

thanks

[492 byte] By [KsRa] at [2007-11-27 2:55:23]
# 1
bb.join() (try googling for "thread join java" for further info).
EvilBroa at 2007-7-12 3:32:06 > top of Java-index,Java Essentials,New To Java...