comparison OrthancServer/ServerIndex.cpp @ 1306:8cd5784a6d80

IDatabaseWrapper::HasFlushToDisk()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 10 Feb 2015 17:17:25 +0100
parents 536515f87cb4
children 61ce8147f30d
comparison
equal deleted inserted replaced
1305:536515f87cb4 1306:8cd5784a6d80
551 551
552 // Initial recycling if the parameters have changed since the last 552 // Initial recycling if the parameters have changed since the last
553 // execution of Orthanc 553 // execution of Orthanc
554 StandaloneRecycling(); 554 StandaloneRecycling();
555 555
556 flushThread_ = boost::thread(FlushThread, this); 556 if (db.HasFlushToDisk())
557 {
558 flushThread_ = boost::thread(FlushThread, this);
559 }
560
557 unstableResourcesMonitorThread_ = boost::thread(UnstableResourcesMonitorThread, this); 561 unstableResourcesMonitorThread_ = boost::thread(UnstableResourcesMonitorThread, this);
558 } 562 }
559 563
560 564
561 ServerIndex::~ServerIndex() 565 ServerIndex::~ServerIndex()
562 { 566 {
563 done_ = true; 567 done_ = true;
564 568
565 if (flushThread_.joinable()) 569 if (db_.HasFlushToDisk() &&
570 flushThread_.joinable())
566 { 571 {
567 flushThread_.join(); 572 flushThread_.join();
568 } 573 }
569 574
570 if (unstableResourcesMonitorThread_.joinable()) 575 if (unstableResourcesMonitorThread_.joinable())