Mercurial > hg > orthanc
comparison OrthancServer/Sources/Database/StatelessDatabaseOperations.h @ 4594:d494b4f1103e db-changes
removed the global database mutex from ServerIndex and StatelessDatabaseOperations
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 16 Mar 2021 12:43:43 +0100 |
parents | ff8170d17d90 |
children | cc64385593ef |
comparison
equal
deleted
inserted
replaced
4593:60a860942c5e | 4594:d494b4f1103e |
---|---|
36 #include "../../../OrthancFramework/Sources/DicomFormat/DicomMap.h" | 36 #include "../../../OrthancFramework/Sources/DicomFormat/DicomMap.h" |
37 | 37 |
38 #include "IDatabaseWrapper.h" | 38 #include "IDatabaseWrapper.h" |
39 #include "../DicomInstanceOrigin.h" | 39 #include "../DicomInstanceOrigin.h" |
40 | 40 |
41 #include <boost/thread/mutex.hpp> // TODO - REMOVE | 41 #include <boost/shared_ptr.hpp> |
42 | 42 |
43 | 43 |
44 namespace Orthanc | 44 namespace Orthanc |
45 { | 45 { |
46 class DatabaseLookup; | 46 class DatabaseLookup; |
84 public: | 84 public: |
85 virtual ~ITransactionContextFactory() | 85 virtual ~ITransactionContextFactory() |
86 { | 86 { |
87 } | 87 } |
88 | 88 |
89 // WARNING: This method can be invoked from several threads concurrently | |
89 virtual ITransactionContext* Create() = 0; | 90 virtual ITransactionContext* Create() = 0; |
90 }; | 91 }; |
91 | 92 |
92 | 93 |
93 class ReadOnlyTransaction : public boost::noncopyable | 94 class ReadOnlyTransaction : public boost::noncopyable |
403 private: | 404 private: |
404 class MainDicomTagsRegistry; | 405 class MainDicomTagsRegistry; |
405 class Transaction; | 406 class Transaction; |
406 | 407 |
407 IDatabaseWrapper& db_; | 408 IDatabaseWrapper& db_; |
408 boost::mutex databaseMutex_; // TODO - REMOVE | |
409 std::unique_ptr<ITransactionContextFactory> factory_; | 409 std::unique_ptr<ITransactionContextFactory> factory_; |
410 unsigned int maxRetries_; | 410 unsigned int maxRetries_; |
411 boost::shared_ptr<MainDicomTagsRegistry> mainDicomTagsRegistry_; // "shared_ptr" because of PImpl | 411 boost::shared_ptr<MainDicomTagsRegistry> mainDicomTagsRegistry_; // "shared_ptr" because of PImpl |
412 bool hasFlushToDisk_; | 412 bool hasFlushToDisk_; |
413 | 413 |