zhenkai.zhang Posted January 28, 2013 Report Posted January 28, 2013 Hi, In the get_next_transaction() function of peq_with_get class, isn't this statement "m_event.notify(m_scheduled_events.begin()->first - now);" should also be in the previous if statement block? namely, if (m_scheduled_events.begin()->first <= now) { transaction_type* trans = m_scheduled_events.begin()->second; m_scheduled_events.erase(m_scheduled_events.begin()); //----------------------------------------------------------- // duplicate the statement here m_event.notify(m_scheduled_events.begin()->first - now); //------------------------------------------------------------ return trans; } otherwise, some later transactions won't pop up since m_event is not set again. Is this right? or I misunderstand the usage of peq_with_get? Quote
zhenkai.zhang Posted January 28, 2013 Author Report Posted January 28, 2013 Well, never mind. I think I misunderstood the usage of get_next_transaction() function. I should put "trans = get_next_transaction()" in a while loop to let the transactions with later delays get processed. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.