Alright here's what I'm doing and I need to know if there are any dangers that I'm missing or even a better way of doing this.
Calling beginthreadex() for a checkkeystroke function that will call endthreadex(0) once a key is hit.
calling beginthreadex() again for another function that will listen on a udp port for incoming messages.
Then still in main call WaitForSingleObject( hThread, INFINITE ); to wait for the key press thread to come back
after that I'll just CloseHandle() both thread handles and exit main.
Now, I want to know that since I'm not using endthreadex on my second thread if it will cause some stack error or leave memory hangin and not being used and just sit there until a reboot.
any ideas, suggestions?
How can I end a thread outside of the actual thread function safely?
Thanks,
Martin I don't suffer from insanity.
I enjoy every minute of it.
Calling beginthreadex() for a checkkeystroke function that will call endthreadex(0) once a key is hit.
calling beginthreadex() again for another function that will listen on a udp port for incoming messages.
Then still in main call WaitForSingleObject( hThread, INFINITE ); to wait for the key press thread to come back
after that I'll just CloseHandle() both thread handles and exit main.
Now, I want to know that since I'm not using endthreadex on my second thread if it will cause some stack error or leave memory hangin and not being used and just sit there until a reboot.
any ideas, suggestions?
How can I end a thread outside of the actual thread function safely?
Thanks,
Martin I don't suffer from insanity.
I enjoy every minute of it.