C# - Thread does not abort on application closing

Posted by michal on Stack Overflow See other posts from Stack Overflow or by michal
Published on 2010-05-17T21:45:22Z Indexed on 2010/05/17 22:01 UTC
Read the original article Hit count: 240

Filed under:
|
|
|
|

Hi, I have an application which does some background task (network listening & reading) in separate Thread. It seems however that the Thread is not being Terminated/Aborted when I close the application (click "x" button on titlebar ;)). Is that because the main Thread routine is while(true) {...} ? What is the solution here? I was looking for some "interruption" flag for the Thread as the condition for "while" loop, but didn't found any ...

© Stack Overflow or respective owner

Related posts about c#

Related posts about thread