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).
In reply to Re: Thread detach
by BrowserUk
in thread Thread detach
by ilanv
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |