Mercurial > hg > orthanc
comparison OrthancServer/Sources/ServerJobs/ThreadedSetOfInstancesJob.cpp @ 5453:b750777c36a2
fix
author | Alain Mazy <am@osimis.io> |
---|---|
date | Wed, 06 Dec 2023 14:19:59 +0100 |
parents | 9ffd6d18daf3 |
children | 48b8dae6dc77 |
comparison
equal
deleted
inserted
replaced
5452:8345267e8de5 | 5453:b750777c36a2 |
---|---|
241 } | 241 } |
242 | 242 |
243 | 243 |
244 void ThreadedSetOfInstancesJob::InstanceWorkerThread(ThreadedSetOfInstancesJob* that) | 244 void ThreadedSetOfInstancesJob::InstanceWorkerThread(ThreadedSetOfInstancesJob* that) |
245 { | 245 { |
246 static uint8_t threadCounter = 0; | 246 static uint16_t threadCounter = 0; |
247 Logging::SetCurrentThreadName(std::string("JOB-INS-WORK-") + boost::lexical_cast<std::string>(threadCounter++)); | 247 Logging::SetCurrentThreadName(std::string("JOB-INS-WORK-") + boost::lexical_cast<std::string>(threadCounter++)); |
248 threadCounter %= 1000; | |
248 | 249 |
249 while (true) | 250 while (true) |
250 { | 251 { |
251 std::unique_ptr<SingleValueObject<std::string> > instanceId(dynamic_cast<SingleValueObject<std::string>*>(that->instancesToProcessQueue_.Dequeue(0))); | 252 std::unique_ptr<SingleValueObject<std::string> > instanceId(dynamic_cast<SingleValueObject<std::string>*>(that->instancesToProcessQueue_.Dequeue(0))); |
252 if (that->stopRequested_ // no lock(mutex) to access this variable, this is safe since it's just reading a boolean | 253 if (that->stopRequested_ // no lock(mutex) to access this variable, this is safe since it's just reading a boolean |