I am trying to implement a state machine as a part of a class called" Source Transaction". Evey-time I receive a request in the main thread, it generates an instance of this class and the state machine starts executing until it reaches a state where it has to wait for a response in the main thread in the "event_handler". To solve this issue, I am implementing a conditional variable using boost libraries as following:
Source Transaction Class
mState = SRC_WAIT_HO_COMPLETE_INDICATION;
response_received = false;
And in the main file I have the following:
tpool->find(msg.source(), mobile_id.to_string(), t);
t->response_received = true;
My problem is, every-time I execute the code, the state machine gets trapped in the "wait_ho_complete_indication_state" and it doesn't leave that state ,and additional to that the event_handler doesn't report that it has received any event. Like the main is being hanged.
So my question is there any problem in the implementation of the conditional variable?
Thanks a lot.