1 // Asynchronous communicator
17 // Send a message to the "dest" mailbox
18 void send(const char* dest, message* msg);
20 // Try to flush pending sending communications.
21 // If "wait" is true, blocks until success.
22 void flush(bool wait);
24 // Try to get a message. Returns true on success.
25 // Parameter "timeout" may be 0 for non-blocking operation, -1 for
26 // infinite waiting, or any positive timeout.
27 bool recv(message*& msg, m_host_t& from, double timeout);
33 // List of pending send communications
34 std::list<msg_comm_t> sent_comm;
36 // Queue of received messages
37 message_queue received;
39 // Handling of receiving thread
40 mutex_t receiver_mutex;
41 condition_t receiver_cond;
42 m_process_t receiver_thread;
43 static int receiver_wrapper(int, char* []);
46 // Used to chek if a communication is successfull before destroying it
47 static void comm_check_n_destroy(msg_comm_t comm);
48 // If comm is over, call comm_check_n_destroy(comm), and return true
49 static bool comm_test_n_destroy(msg_comm_t comm);
52 #endif // !COMMUNICATOR_H