Hi,
According to the code
struct Working:sc::state< Working, Active >
{
Working(my_context ctx):my_base(ctx)
{
cout<<__FUNCTION__<<endl;
outermost_context_type& machine=outermost_context(); // machine is a asynchronous machine.
A machine.post_event( EvtTerminate() );
B machine.my_scheduler().queue_event( machine.my_handle(),boost::intrusive_ptr<EvtTerminate>(new EvtTerminate() ) );
};
~Working(void)
{
cout<<__FUNCTION__<<endl;
}
typedef sc::transition< EvtIdleWork,Idle > reactions;
};
Is there any difference between A and B? Which is the better and recommended or Is there another better way to post event?
Thank you.