comparison OrthancStone/Sources/Oracle/ThreadedOracle.cpp @ 1571:85e117739eca

cppcheck
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 21 Sep 2020 17:46:39 +0200
parents 244ad1e4e76a
children 4fb8fdf03314
comparison
equal deleted inserted replaced
1570:9a04f42098a3 1571:85e117739eca
322 322
323 void ThreadedOracle::SetThreadsCount(unsigned int count) 323 void ThreadedOracle::SetThreadsCount(unsigned int count)
324 { 324 {
325 boost::mutex::scoped_lock lock(mutex_); 325 boost::mutex::scoped_lock lock(mutex_);
326 326
327 if (count <= 0) 327 if (count == 0)
328 { 328 {
329 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); 329 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
330 } 330 }
331 else if (state_ != State_Setup) 331 else if (state_ != State_Setup)
332 { 332 {
342 342
343 void ThreadedOracle::SetSleepingTimeResolution(unsigned int milliseconds) 343 void ThreadedOracle::SetSleepingTimeResolution(unsigned int milliseconds)
344 { 344 {
345 boost::mutex::scoped_lock lock(mutex_); 345 boost::mutex::scoped_lock lock(mutex_);
346 346
347 if (milliseconds <= 0) 347 if (milliseconds == 0)
348 { 348 {
349 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); 349 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
350 } 350 }
351 else if (state_ != State_Setup) 351 else if (state_ != State_Setup)
352 { 352 {