From: Pierre-Luc B. <pie...@sa...> - 2009-07-14 15:18:27
|
Calling leave() makes our application to wait for 10 sec. This can be a problem as a user might want to restart the application during that 10sec time frame. From eventloop.cpp, I see that: int wait_min = 10000; 158 159 DefaultTimeouts::iterator ti; 160 161 _mutex_t.lock(); 162 163 for (ti = _timeouts.begin(); ti != _timeouts.end(); ++ti) { 164 if ( (*ti)->enabled() && (*ti)->interval() < wait_min) 165 wait_min = (*ti)->interval(); 166 } 167 168 _mutex_t.unlock(); 169 170 poll (fds, nfd, wait_min); >From what I get of this portion of code, it loops to find the DefaultTimeout with the smallest time interval, then poll with that value. Is this meant to be used internally for dbus-c++ only or could we add_timeout(Timeout::Internal *) without fear of breaking the eventloop mechanism ? Since: while (_running) { do_iteration(); } in enter() (eventloop-integration.cpp) and: void BusDispatcher::leave() { _running = false; } wouldn't it be better to think of another way to leave the event loop in a more instantaneous manner ? Pierre-Luc Bacon, Savoir-Faire Linux http://www.sflphone.org |