Skip to content

Commit

Permalink
Update srutils
Browse files Browse the repository at this point in the history
  • Loading branch information
issakomi committed May 18, 2024
1 parent edb3516 commit 39acab9
Showing 1 changed file with 9 additions and 22 deletions.
31 changes: 9 additions & 22 deletions dicom/srutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include <QPainterPath>
#include <QPen>
#include <QBrush>
#include <QElapsedTimer>
#include <QApplication>
#include "processimagethreadLUT.hxx"
#include "settingswidget.h"
Expand Down Expand Up @@ -196,32 +195,20 @@ template<typename T> SRImage li3(
}
//
const size_t threadsLUT_size = threadsLUT_.size();
for (size_t i = 0; i < threadsLUT_size; ++i)
{
QElapsedTimer etimer;
etimer.start();
while (true)
{
if (etimer.elapsed() > 1)
{
size_t b__{};
for (size_t i = 0; i < threadsLUT_size; ++i)
{
if (threadsLUT_.at(i)->isFinished()) ++b__;
}
if (b__ == threadsLUT_size)
{
break;
}
else
{
etimer.start();
}
}
}
threadsLUT_[i]->wait(10000);
}
for (size_t i = 0; i < threadsLUT_size; ++i)
{
if (threadsLUT_.at(i)->isRunning())
{
// should never happen
threadsLUT_[i]->terminate();
threadsLUT_[i]->wait();
}
delete threadsLUT_[i];
threadsLUT_[i] = nullptr;
}
threadsLUT_.clear();
//
Expand Down

0 comments on commit 39acab9

Please sign in to comment.