- SIMIX_mutex_unlock(remote_host->simdata->mutex);
-
- SIMIX_mutex_lock(t_simdata->mutex);
-
- process->simdata->waiting_action = t_simdata->comm; // for debugging and status displaying purpose
-
- if (timeout > 0) {
- xbt_ex_t e;
- double time;
- double time_elapsed;
- time = SIMIX_get_clock();
-
- TRY {
- /*verify if the action that ends is the correct. Call the wait_timeout with the new time. If the timeout occurs, an exception is raised */
- while (1) {
- time_elapsed = SIMIX_get_clock() - time;
- SIMIX_cond_wait_timeout(t_simdata->cond, t_simdata->mutex,
- timeout - time_elapsed);
-
- if (t_simdata->comm)
- SIMIX_action_use(t_simdata->comm);
- if (t_simdata->comm && (SIMIX_action_get_state(t_simdata->comm) !=
- SURF_ACTION_RUNNING))
- break;
- if (!SIMIX_host_get_state(local_host->simdata->smx_host))
- break;
- if (!SIMIX_host_get_state(remote_host->simdata->smx_host))
- break;
- }
- }
- CATCH(e) {
- if (e.category == timeout_error) {
- xbt_ex_free(e);
- /* verify if the timeout happened and the communication didn't started yet */
- if (t_simdata->comm == NULL) {
- DEBUG1("Action terminated %s (there was a timeout)", task->name);
- process->simdata->waiting_action = NULL;
-
- /* remove the task from the mailbox */
- MSG_mailbox_remove(mailbox, task);
-
-/* if (t_simdata->receiver && t_simdata->receiver->simdata) { /\* receiver still around *\/ */
-/* t_simdata->receiver->simdata->waiting_task = NULL; */
-/* } */
-
- SIMIX_mutex_unlock(t_simdata->mutex);
- MSG_RETURN(MSG_TRANSFER_FAILURE);
- }
- } else {
- RETHROW;
- }
- }
- } else {
- while (1) { //FIXME: factorize with the code right above
- SIMIX_cond_wait(t_simdata->cond, t_simdata->mutex);
-
- if (t_simdata->comm)
- SIMIX_action_use(t_simdata->comm);
- if (t_simdata->comm
- && SIMIX_action_get_state(t_simdata->comm) != SURF_ACTION_RUNNING)
- break;
- if (!SIMIX_host_get_state(local_host->simdata->smx_host))
- break;
- if (!SIMIX_host_get_state(remote_host->simdata->smx_host))
- break;
- }
- }
+#ifdef MSG_USE_DEPRECATED
+msg_mailbox_t MSG_mailbox_get_by_channel(msg_host_t host,
+ m_channel_t channel)
+{
+ XBT_WARN("DEPRECATED! Now use MSG_mailbox_get_by_alias");
+ xbt_assert((host != NULL), "Invalid host");
+ xbt_assert((channel >= 0)
+ && (channel < msg_global->max_channel), "Invalid channel %d",
+ channel);