From: cristianrosa Date: Thu, 30 Sep 2010 10:03:48 +0000 (+0000) Subject: Fix race condition during the creation of the listeners processes X-Git-Tag: v3_5~523 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/1038b1a8e8bcb6f17417a1027a6c59438d248555?hp=ad77e9774aebd33513423dd4e4768bd695cd93f2 Fix race condition during the creation of the listeners processes git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8301 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/gras/Msg/gras_msg_listener.c b/src/gras/Msg/gras_msg_listener.c index 9649e53a6d..3540090d04 100644 --- a/src/gras/Msg/gras_msg_listener.c +++ b/src/gras/Msg/gras_msg_listener.c @@ -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(),