-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;
-}
-
-int communicator::receiver_wrapper(int, char* [])
-{
- communicator* comm;
- comm = static_cast<communicator*>(MSG_process_get_data(MSG_process_self()));
- comm->receiver();
-
- XBT_DEBUG("terminate");
- comm->receiver_mutex.acquire();
- comm->receiver_thread = NULL;
- comm->receiver_cond.signal();
- comm->receiver_mutex.release();
-
- return 0;
-}
-