Jump to content

A bug in peq_with_get class?


Recommended Posts

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?

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...