Index: tao/Leader_Follower_Flushing_Strategy.cpp =================================================================== --- tao/Leader_Follower_Flushing_Strategy.cpp (revision 86155) +++ tao/Leader_Follower_Flushing_Strategy.cpp (working copy) @@ -49,7 +49,21 @@ while (!transport->queue_is_empty ()) { - if (orb_core->run (max_wait_time, 1) == -1) + // In case max_wait_time==0 we cannot simply run the orb because + // in multi-threaded applications it can easily happen that + // the other thread will run the orb and drain the queue in the + // transport we're coping with here and this thread will block. + // Instead we do run for a small amount of time and then recheck + // the queue. + if (max_wait_time == 0) + { + ACE_Errno_Guard eguard (errno); + + // Poll the reactor's queue. + ACE_Time_Value tv = ACE_Time_Value::zero; + orb_core->run (&tv, 1); + } + else if (orb_core->run (max_wait_time, 1) == -1) return -1; if (max_wait_time != 0) {