multithreading - Calling abstract function on boost thread, does not interrupt at interruption_point -
I created an abstract base class to allow multiple implementations of a task, which is usually said through the MFC dialogue This can be done if the user cancels the click then it should be able to interrupt the work.
abstract_dll.h: Where concrete_dll.h: Now within the MFC dialog I load the appropriate concrete.dll and my Then start a new Then when I call Any thoughts? PS The above code is just a fake code for me. My real code compiles and runs, I can not get it for interrupt I find the answer here is: < P> Briefly: You must link to the promotion DLL version: Both threads in your project and DLL Just enter: before BR
category abstract_dll {public: virtual zero my_task (CFBACK * FB) = 0;
CFeadback is an abstract class to control user feedback (i.e. progress bar)
class concrete_dll {virtual zero my_task (cadback * fb) {// some work / step progress bar boost :: this_thread :: interruption_point (); // Something Work // Step Progress Bar Boost :: this_thread :: interruption_point (); }} Extern "C" abstract_dll * get_class () {new concrete_dll (); }
abstract_dll * dll = module-> gt_ get_class ();
boost :: thread , which is
dll-> Calls my_task (fb);
thread .interrupt () . The thread is never interrupted, and it never excepts at the points of my blockage. I have detected the thread ID, I get 0x0000 for the thread ID until we are in solid DDL implementation < Br>
#define BOOST_THREAD_USE_DLL
& quot; Boost / thread.hpp & gt; Inclusion (or Propeties in Project)
Comments
Post a Comment