1

i want to Close the thread which was initialized by the _beginthreadex. as i am also using Qt for GUI so when i use _endthreadex() then it Closes all threads which are running but i only want to Close or Exit the thread which was began by the _beginthreadex().

arslanekhan
  • 147
  • 1
  • 9
  • I have always simple returned and integer for my thread functions executed using _beginthreadex(). _endthreadex() is called automatically, when threads return. – Jens Munk Apr 15 '14 at 14:13
  • Sorry, you should make sure it is the thread that's is executing _endthreadex() and not your main thread. If it is the latter, then everything exists – Jens Munk Apr 15 '14 at 14:15
  • Threads must exit themselves, you cannot (safely) force another thread to close. You need to arrange a way to tell the thread when it is time for it to exit. Available mechanisms vary depending on what exactly the thread is doing. – Harry Johnston Apr 15 '14 at 22:08
  • actually the Problem is Qt will run always in a separate thread but i only want to Exit a specific thread...but _endthreadex() Closes all threads including GUI – arslanekhan Apr 16 '14 at 12:13

0 Answers0