comparison Framework/Plugins/IndexBackend.cpp @ 232:4e15eace9b90

reorganization in DatabaseBackendAdapterV3
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 06 Apr 2021 12:50:06 +0200
parents a4918d57435c
children d1b124d116c1
comparison
equal deleted inserted replaced
231:0a9b48d19643 232:4e15eace9b90
316 } 316 }
317 317
318 318
319 void IndexBackend::SetOutputFactory(IDatabaseBackendOutput::IFactory* factory) 319 void IndexBackend::SetOutputFactory(IDatabaseBackendOutput::IFactory* factory)
320 { 320 {
321 boost::unique_lock<boost::shared_mutex> lock(outputFactoryMutex_);
322
321 if (factory == NULL) 323 if (factory == NULL)
322 { 324 {
323 throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer); 325 throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer);
324 } 326 }
325 else if (outputFactory_.get() != NULL) 327 else if (outputFactory_.get() != NULL)
333 } 335 }
334 336
335 337
336 IDatabaseBackendOutput* IndexBackend::CreateOutput() 338 IDatabaseBackendOutput* IndexBackend::CreateOutput()
337 { 339 {
340 boost::shared_lock<boost::shared_mutex> lock(outputFactoryMutex_);
341
338 if (outputFactory_.get() == NULL) 342 if (outputFactory_.get() == NULL)
339 { 343 {
340 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls); 344 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
341 } 345 }
342 else 346 else