diff --git a/cpp/test/Ice/dispatcher/Dispatcher.cpp b/cpp/test/Ice/dispatcher/Dispatcher.cpp index 53b3195dd97..f88fce0a2fe 100644 --- a/cpp/test/Ice/dispatcher/Dispatcher.cpp +++ b/cpp/test/Ice/dispatcher/Dispatcher.cpp @@ -10,7 +10,7 @@ #include #include -Dispatcher* Dispatcher::_instance = 0; +IceUtil::Handle Dispatcher::_instance; Dispatcher::Dispatcher() { @@ -59,12 +59,12 @@ Dispatcher::run() Ice::DispatcherCallPtr call; { Lock sync(*this); - + while(!_terminated && _calls.empty()) - { + { wait(); } - + if(!_calls.empty()) { call = _calls.front(); @@ -76,8 +76,8 @@ Dispatcher::run() return; } } - - + + if(call) { try diff --git a/cpp/test/Ice/dispatcher/Dispatcher.h b/cpp/test/Ice/dispatcher/Dispatcher.h index a6d10e0514c..ba81c3f8293 100644 --- a/cpp/test/Ice/dispatcher/Dispatcher.h +++ b/cpp/test/Ice/dispatcher/Dispatcher.h @@ -24,7 +24,7 @@ class Dispatcher : public Ice::Dispatcher, IceUtil::Thread, IceUtil::Monitor _instance; std::deque _calls; bool _terminated;