Carsten Hoyer wrote:Ah, ok i forgot to include a running clause in the method. So in the above example. A new thread is only created when the old thread stops running.
Both bits of your code will never start more than one thread. If I read your question correctly you want to start a new thread as soon as the previous one stops (running == false). If so the code above does not do that.