comparison Framework/Oracle/ThreadedOracle.cpp @ 760:1181e1ad98ec

progressive loading working
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 22 May 2019 18:34:06 +0200
parents ab236bb5dbc7
children f6438fdc447e
comparison
equal deleted inserted replaced
759:774681b2c77c 760:1181e1ad98ec
85 if (command == NULL) 85 if (command == NULL)
86 { 86 {
87 throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer); 87 throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer);
88 } 88 }
89 89
90 expiration_ = (boost::posix_time::second_clock::local_time() + 90 expiration_ = (boost::posix_time::microsec_clock::local_time() +
91 boost::posix_time::milliseconds(command_->GetDelay())); 91 boost::posix_time::milliseconds(command_->GetDelay()));
92 } 92 }
93 93
94 const boost::posix_time::ptime& GetExpirationTime() const 94 const boost::posix_time::ptime& GetExpirationTime() const
95 { 95 {
132 132
133 void AwakeExpired(IMessageEmitter& emitter) 133 void AwakeExpired(IMessageEmitter& emitter)
134 { 134 {
135 boost::mutex::scoped_lock lock(mutex_); 135 boost::mutex::scoped_lock lock(mutex_);
136 136
137 const boost::posix_time::ptime now = boost::posix_time::second_clock::local_time(); 137 const boost::posix_time::ptime now = boost::posix_time::microsec_clock::local_time();
138 138
139 Content stillSleeping; 139 Content stillSleeping;
140 140
141 for (Content::iterator it = content_.begin(); it != content_.end(); ++it) 141 for (Content::iterator it = content_.begin(); it != content_.end(); ++it)
142 { 142 {
437 orthanc_ = orthanc; 437 orthanc_ = orthanc;
438 } 438 }
439 } 439 }
440 440
441 441
442 void ThreadedOracle::SetWorkersCount(unsigned int count) 442 void ThreadedOracle::SetThreadsCount(unsigned int count)
443 { 443 {
444 boost::mutex::scoped_lock lock(mutex_); 444 boost::mutex::scoped_lock lock(mutex_);
445 445
446 if (count <= 0) 446 if (count <= 0)
447 { 447 {