diff OrthancServer/ServerContext.h @ 526:e318e9d49815 dicom-rt

rt-struct
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 29 Aug 2013 17:33:33 +0200
parents 2d269089078f
children 8cfc6119a5bd
line wrap: on
line diff
--- a/OrthancServer/ServerContext.h	Thu Aug 29 15:10:05 2013 +0200
+++ b/OrthancServer/ServerContext.h	Thu Aug 29 17:33:33 2013 +0200
@@ -40,6 +40,8 @@
 #include "ServerIndex.h"
 #include "FromDcmtkBridge.h"
 
+#include <boost/thread.hpp>
+
 namespace Orthanc
 {
   /**
@@ -63,6 +65,8 @@
       virtual IDynamicObject* Provide(const std::string& id);
     };
 
+    boost::mutex cacheMutex_;
+
     FileStorage storage_;
     ServerIndex index_;
     CompressedFileStorageAccessor accessor_;
@@ -133,6 +137,13 @@
     // TODO IMPLEMENT MULTITHREADING FOR THIS METHOD
     ParsedDicomFile& GetDicomFile(const std::string& instancePublicId);
 
+    boost::mutex& GetDicomFileMutex()
+    {
+      // TODO IMPROVE MULTITHREADING
+      // Every call to "ParsedDicomFile" must lock this mutex!!!
+      return cacheMutex_;
+    }
+
     LuaContext& GetLuaContext()
     {
       return lua_;