void communicator::flush(bool wait)
{
- sent_comm.remove_if(comm_test_n_destroy);
+ sent_comm_type::iterator bound;
+ bound = std::remove_if(sent_comm.begin(), sent_comm.end(),
+ comm_test_n_destroy);
+ sent_comm.erase(bound, sent_comm.end());
if (wait && !sent_comm.empty()) {
msg_comm_t comms[sent_comm.size()];
std::copy(sent_comm.begin(), sent_comm.end(), comms);
}
}
-bool communicator::recv(message*& msg, m_host_t& from, double timeout)
-{
- XBT_DEBUG("waiting for a message to come");
- bool recvd = received.pop(msg, from, timeout);
- if (recvd)
- XBT_DEBUG("received %s from %s",
- msg->to_string().c_str(), MSG_host_get_name(from));
- return recvd;
-}
-
void communicator::receiver()
{
xbt_dynar_t comms = xbt_dynar_new(sizeof(msg_comm_t), NULL);