From 3d9d98b8db89fbb8b6907f5875e82607712e0731 Mon Sep 17 00:00:00 2001 From: mquinson Date: Wed, 4 Jun 2008 16:05:55 +0000 Subject: [PATCH] Solve the empty_main bug: simply yield main gras thread right after the listener creation so that it gets a chance to finish its initialization before we cancel it right away if the main is empty git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@5528 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/gras/Msg/gras_msg_listener.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gras/Msg/gras_msg_listener.c b/src/gras/Msg/gras_msg_listener.c index c1862247c8..3d74618de4 100644 --- a/src/gras/Msg/gras_msg_listener.c +++ b/src/gras/Msg/gras_msg_listener.c @@ -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; } -- 2.20.1