Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix race condition during the creation of the listeners processes
authorcristianrosa <cristianrosa@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 30 Sep 2010 10:03:48 +0000 (10:03 +0000)
committercristianrosa <cristianrosa@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 30 Sep 2010 10:03:48 +0000 (10:03 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8301 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/gras/Msg/gras_msg_listener.c

index 9649e53..3540090 100644 (file)
@@ -98,6 +98,9 @@ gras_msg_listener_t gras_msg_listener_launch(xbt_queue_t msg_received)
   arg->listener = xbt_thread_create("listener", listener_function, arg,1/*joinable*/);
   gras_os_sleep(0);             /* give the listener a chance to initialize before we connect to its socket */
 
+  /* We do an active wait until the listener had created the socket (FIXME: ugly hack ) */
+  while(arg->wakeup_sock_listener_side == NULL);
+  
   /* Connect the other part of the socket */
   arg->wakeup_sock_master_side =
     gras_socket_client(gras_os_myname(),