Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Resetting the rate to default should be done before the call to
[simgrid.git] / src / msg / gos.c
index f61ed61..da0b425 100644 (file)
@@ -277,7 +277,7 @@ int MSG_task_probe_from(m_channel_t channel)
 /** \ingroup msg_gos_functions
  * \brief Wait for at most \a max_duration second for a task reception
    on \a channel. *\a PID is updated with the PID of the first process
-   that triggered this event is any.
+   that triggered this event if any.
  *
  * It takes three parameters:
  * \param channel the channel on which the agent should be
@@ -306,7 +306,8 @@ MSG_error_t MSG_channel_select_from(m_channel_t channel, double max_duration,
   }
 
   if(max_duration==0.0) {
-    return MSG_task_probe_from(channel);
+    *PID = MSG_task_probe_from(channel);
+    MSG_RETURN(MSG_OK);
   } else {
     CHECK_HOST();
     h = MSG_host_self();
@@ -461,6 +462,7 @@ MSG_error_t MSG_task_put(m_task_t task,
     state=surf_workstation_resource->common_public->action_get_state(task_simdata->comm);
   }
   DEBUG0("Action terminated");
+  task->simdata->rate=-1.0; /* Sets the rate back to default */
 
   PAJE_PROCESS_POP_STATE(process);  
 
@@ -496,7 +498,6 @@ MSG_error_t MSG_task_put_bounded(m_task_t task,
   MSG_error_t res = MSG_OK;
   task->simdata->rate=max_rate;
   res = MSG_task_put(task, dest, channel);
-  task->simdata->rate=-1.0;
   return(res);
 }
 
@@ -726,7 +727,7 @@ MSG_error_t MSG_process_sleep(double nb_sec)
 }
 
 /** \ingroup msg_gos_functions
- * \brief Return the number of MSG tasks currently running on a
+ * \brief Return the number of MSG tasks currently running on
  * the host of the current running process.
  */
 static int MSG_get_msgload(void) 
@@ -742,7 +743,7 @@ static int MSG_get_msgload(void)
 
 /** \ingroup msg_gos_functions
  *
- * \brief Return the the last value returned by a MSG function (except
+ * \brief Return the last value returned by a MSG function (except
  * MSG_get_errno...).
  */
 MSG_error_t MSG_get_errno(void)