-
November 19th, 2003, 04:11 AM
#1
How to end threads good
Hi!
I already solved the problem, but I hope that you have a better solution:
My app uses at least one worker thread. When started, it handles the communication via the rs232-comport.
When the user wants to close the whole app., I first tell the worker-thread to close. The last thing it does before leaving is to set a flag. My main program in the meantime just polls in a loop whether that flag is set. When found, it closes also.
So the worker thread sets the flag that it is closed already! I don't like my software to talk about future states of itself...
The code is working, but I think it is ineffective.
Your hints?
Thanks!
Marc
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|