0

I am using thread

hThreadat = CreateThread(NULL,0,MyFunc,&m_ThreadVec,0,&ThreadIDat);

and code for MyFunc

    DWORD WINAPI  MYFunc(LPVOID temp)
{
//some code
boost::thread u(&faceThread);
u.interrupt();  
return 0;
// new code end}

Problem is= When I close the application all hThreadat threads terminates but boost thread don't. It cause error. How do I close that boost thread when i close the application. Actually boost thread is cascaded within windows threads. Thanks in Advance.

Mustansar Fiaz
  • 769
  • 1
  • 5
  • 7
  • 2
    I don't think `interrupt` is what you're looking for. Typically you'll want to set a variable which causes the function `faceThread` to exit. You would probably then call `u.join()` which will wait until `faceThread` has exited, and then exit the program – Steve Lorimer May 12 '14 at 05:02
  • http://stackoverflow.com/questions/12437395/how-can-i-execute-two-threads-asynchronously-using-boost/12437526#12437526 – Alex F May 12 '14 at 05:17

0 Answers0