Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Solve the empty_main bug: simply yield main gras thread right after the listener...
[simgrid.git] / src / gras / Msg / gras_msg_listener.c
index c186224..3d74618 100644 (file)
@@ -53,6 +53,7 @@ gras_msg_listener_launch(xbt_queue_t msg_exchange){
   arg->incomming_messages = msg_exchange;
 
   arg->listener =  xbt_thread_create("listener",listener_function,arg);
+  gras_os_sleep(0); /* give the listener a chance to initialize even if the main is empty and we cancel it right afterward */
   return arg;
 }