|
Boost Users : |
Subject: Re: [Boost-users] Statechart problem
From: Igor R (boost.lists_at_[hidden])
Date: 2009-03-25 11:19:21
> The UpdateNewCANMessage is a callback function defined in the
> ICANMonitorClient interface. This method is being called when new data
> frames arrive (that works) but then I want to notify the state machine to
> proceed to its next state effectively by sending an EvNewFrame event but
> nothing happens.
>
> I tried this->post_event( EvNewFrame() ); // no effect
> and this->post_event( boost::intrusive_ptr<EvNewFrame>( new EvNewFrame( ) )
> ); // no effect
>
First of all, before calling post_event, you can try and print-out
current states info (see StateChart tutorial). Besides, you can step
into post_event in order to see what happens to that event.
Just one little doubt: don't you try to post_event asynchronously to a
regular state_machine? I.e. isn't UpdateNewCANMessage called from
another thread? If so, it's not safe, as you can't be sure what
exactly happens to the state_machine in that moment.
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