diff options
author | vzykov <vzykov@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2009-06-15 12:50:39 +0000 |
---|---|---|
committer | vzykov <vzykov@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2009-06-15 12:50:39 +0000 |
commit | 8e0405a860107c85e2c017667642ba807116d90b (patch) | |
tree | d763ef22c1717d7daa465985fb5e8fc97cd4b4ec | |
parent | 71be3ec10855aec76f63c6775dcaee3904e685f8 (diff) | |
download | ATCD-8e0405a860107c85e2c017667642ba807116d90b.tar.gz |
ChangeLogTag: Mon Jun 15 12:45:55 UTC 2009 Vladimir Zykov <vz@prismtech.com>
-rw-r--r-- | TAO/ChangeLog | 7 | ||||
-rw-r--r-- | TAO/tao/Leader_Follower_Flushing_Strategy.cpp | 15 |
2 files changed, 16 insertions, 6 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 38eb697da5e..b31bc9f7395 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,10 @@ +Mon Jun 15 12:45:55 UTC 2009 Vladimir Zykov <vz@prismtech.com> + + * tao/Leader_Follower_Flushing_Strategy.cpp: + + Improved the fix for Bug#3697. The while loop now depends + on transpot's queue and the work in the reactor. + Mon Jun 15 10:19:16 UTC 2009 Vladimir Zykov <vz@prismtech.com> * tests/Crash_On_Write/Crash_Task.cpp: diff --git a/TAO/tao/Leader_Follower_Flushing_Strategy.cpp b/TAO/tao/Leader_Follower_Flushing_Strategy.cpp index 7573e9569f8..1aba72d78bc 100644 --- a/TAO/tao/Leader_Follower_Flushing_Strategy.cpp +++ b/TAO/tao/Leader_Follower_Flushing_Strategy.cpp @@ -49,8 +49,12 @@ TAO_Leader_Follower_Flushing_Strategy::flush_transport ( if (max_wait_time == 0) { - // In case max_wait_time==0 it doesn't make sense to run - // while loop depending on transport->queue_is_empty () + // In case max_wait_time==0 we run a while loop depending on + // both transport->queue_is_empty() and reactor->work_pending() + // to make sure that we both dispatch all the messages in the + // transport's queue and at the same time those that we scheduled + // in the reactor but not more then that. However it doesn't + // make sense to check only for transport->queue_is_empty() // since in multi-threaded application it can easily happen // that the other thread will run the orb and drain the // queue in the transport we're coping with here. So, that @@ -61,11 +65,10 @@ TAO_Leader_Follower_Flushing_Strategy::flush_transport ( // since transport will return 0 (letting the reactor know // about more pending work) when handling output/timeout as // long as its queue is not empty. - while (orb_core->reactor ()->work_pending ()) + while (orb_core->orb ()->work_pending () && + !transport->queue_is_empty ()) { - ACE_Time_Value tv (0, 100); - if (orb_core->run (&tv, 1) == -1) - return -1; + orb_core->orb ()->perform_work (); } } else |