in reply to Thread detach
After you set you thread running, your main thread does nothing and just runs of the end of the code. When it does so, the other thread you started is still running (in fact it will never end as it is an elndless loop) and so you get the warning.
when you start a second thread you need to arrange for you main thread to not terminate until your second thread has finished. The normal way to do this is to use join--which precludes using detach.
ps. Please wrap your code in code tags (see the bottom of the screen when you are posting for details).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Thread detach
by ilanv (Initiate) on Jan 24, 2005 at 23:19 UTC | |
by BrowserUk (Patriarch) on Jan 24, 2005 at 23:37 UTC |