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:

  category abstract_dll {public: virtual zero my_task (CFBACK * FB) = 0;   

Where CFeadback is an abstract class to control user feedback (i.e. progress bar)

concrete_dll.h:

  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 (); }   

Now within the MFC dialog I load the appropriate concrete.dll and my abstract_dll * dll = module-> gt_ get_class ();

Then start a new boost :: thread , which is dll-> Calls my_task (fb);

Then when I call 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>

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:

  #define BOOST_THREAD_USE_DLL   

before & quot; Boost / thread.hpp & gt; Inclusion (or Propeties in Project)

BR

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -