Archived

This forum has been archived. Please start a new discussion on GitHub.

How re-start the thread

I make a WorkQueue inherited from IceUtil::Thread;
like this
WorkQueuePtr h = new WorkQueue();
IceUtil::ThreadControl control = h->start();
First I call
control.yield();
want to stop the h thread.
And I call
control = h->start();
again .this code throw.
.\Thread.cpp:227: IceUtil::ThreadStartedException


My question is how can I re-start a thread ?

Comments

  • marc
    marc Florida
    Threads cannot be restarted. You must create a new thread.