Thread not interrupted in runtime linked library

Hi, Using boost thread a new thread is created. The thread loads a DLL using LoadLibrary() call, gets the procedure address by calling GetProcAddress() and executes the procedure. The body of procedure is an infinite loop. When I try to interrupt the thread from main thread it is not interrrupted! What could be the reason? In all other cases the thread is interrupted except when it is inside the dynamically (runtime) linked library procedure. What could be the reason? Please share some idea... Thank you very much Lloyd ___________________ Happy New Year 2010

"Lloyd"
Using boost thread a new thread is created. The thread loads a DLL using LoadLibrary() call, gets the procedure address by calling GetProcAddress() and executes the procedure. The body of procedure is an infinite loop. When I try to interrupt the thread from main thread it is not interrrupted! What could be the reason? In all other cases the thread is interrupted except when it is inside the dynamically (runtime) linked library procedure. What could be the reason? Please share some idea...
For this to work both the loaded DLL and the main app must use the DLL version of boost.thread. Otherwise, they have separate versions of the internal data structures used for interruption, so the code in the DLL will check the wrong flag and won't see the interruption status as set by the main app. Anthony -- Author of C++ Concurrency in Action http://www.stdthread.co.uk/book/ just::thread C++0x thread library http://www.stdthread.co.uk Just Software Solutions Ltd http://www.justsoftwaresolutions.co.uk 15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK. Company No. 5478976

Thank you very muh, that solved the problem.
For this to work both the loaded DLL and the main app must use the DLL version of boost.thread. Otherwise, they have separate versions of the internal data structures used for interruption, so the code in the DLL will check the wrong flag and won't see the interruption status as set by the main app.
Anthony
___________________ Happy New Year 2010
participants (2)
-
Anthony Williams
-
Lloyd