Commit d121b2961f566a63e17f974fd8d39ed4d84ae361

  • avatar
  • Sergey 'Jin' Bostandzhyan <jin @deve…per.digitalstrom.org>
  • Tue Jul 27 13:01:51 CEST 2010
Updated code according to requests in the MR
core/event.cpp
(5 / 9)
  
4949#include <Poco/SAX/InputSource.h>
5050#include <Poco/SAX/SAXException.h>
5151
52#define MAX_WAIT_SECONDS 2 // seconds, must be > 0
53
5452using Poco::XML::Document;
5553using Poco::XML::Element;
5654using Poco::XML::Attr;
6262using std::set;
6363
6464namespace dss {
65
65 /* maximum time to block, must be > 0 */
66 const int kMaxSleepTimeSeconds = 2;
6667 //================================================== Event
6768
6869 Event::Event(const std::string& _name)
712712 return false;
713713 }
714714
715 int secsToWait = MAX_WAIT_SECONDS;
715 int secsToWait = kMaxSleepTimeSeconds;
716716 do {
717 if (sleepSeconds < MAX_WAIT_SECONDS) {
718 secsToWait = sleepSeconds;
719 } else {
720 secsToWait = MAX_WAIT_SECONDS;
721 }
717
718 secsToWait = std::min(sleepSeconds, kMaxSleepTimeSeconds);
722719
723720 if(!m_NewItem.waitFor(secsToWait * 1000)) {
724721 return raisePendingEvents(m_WakeTime, 2);