Boost logo

Boost Users :

From: Jiang Miao (jiangfriend_at_[hidden])
Date: 2007-07-25 10:13:22


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.



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net