Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
If the timeout is negative, the user wants to block
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sat, 14 Jul 2007 10:13:52 +0000 (10:13 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sat, 14 Jul 2007 10:13:52 +0000 (10:13 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@3786 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/gras/Transport/sg_transport.c

index 3fb3830..b77eae4 100644 (file)
@@ -42,9 +42,13 @@ gras_socket_t gras_trp_select(double timeout) {
         SIMIX_process_get_name(SIMIX_process_self()),
         SIMIX_host_get_name(SIMIX_host_self()),
         timeout);
         SIMIX_process_get_name(SIMIX_process_self()),
         SIMIX_host_get_name(SIMIX_host_self()),
         timeout);
-
-       xbt_queue_shift_timed(pd->msg_selectable_sockets,
-                                                               &active_socket, timeout);
+   if (timeout>=0) {
+      xbt_queue_shift_timed(pd->msg_selectable_sockets,
+                           &active_socket, timeout);
+   } else {
+      xbt_queue_shift(pd->msg_selectable_sockets, &active_socket);
+   }
+   
   if (active_socket == NULL) {
     DEBUG0("TIMEOUT");
     THROW0(timeout_error,0,"Timeout");
   if (active_socket == NULL) {
     DEBUG0("TIMEOUT");
     THROW0(timeout_error,0,"Timeout");