diff OrthancServer/ServerContext.cpp @ 2738:3a55b77339ff

fix deadlock in Lua scripts
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 16 Jul 2018 11:19:30 +0200
parents 1b4ba91fe795
children 37583cd183ed
line wrap: on
line diff
--- a/OrthancServer/ServerContext.cpp	Sun Jul 15 16:41:43 2018 +0200
+++ b/OrthancServer/ServerContext.cpp	Mon Jul 16 11:19:30 2018 +0200
@@ -135,21 +135,21 @@
   void ServerContext::SignalJobSubmitted(const std::string& jobId)
   {
     haveJobsChanged_ = true;
-    lua_.SignalJobSubmitted(jobId);
+    mainLua_.SignalJobSubmitted(jobId);
   }
   
 
   void ServerContext::SignalJobSuccess(const std::string& jobId)
   {
     haveJobsChanged_ = true;
-    lua_.SignalJobSuccess(jobId);
+    mainLua_.SignalJobSuccess(jobId);
   }
 
   
   void ServerContext::SignalJobFailure(const std::string& jobId)
   {
     haveJobsChanged_ = true;
-    lua_.SignalJobFailure(jobId);
+    mainLua_.SignalJobFailure(jobId);
   }
 
 
@@ -225,7 +225,9 @@
     storeMD5_(true),
     provider_(*this),
     dicomCache_(provider_, DICOM_CACHE_SIZE),
-    lua_(*this),
+    mainLua_(*this),
+    filterLua_(*this),
+    luaListener_(*this),
 #if ORTHANC_ENABLE_PLUGINS == 1
     plugins_(NULL),
 #endif
@@ -234,7 +236,7 @@
     queryRetrieveArchive_(Configuration::GetGlobalUnsignedIntegerParameter("QueryRetrieveSize", 10)),
     defaultLocalAet_(Configuration::GetGlobalStringParameter("DicomAet", "ORTHANC"))
   {
-    listeners_.push_back(ServerListener(lua_, "Lua"));
+    listeners_.push_back(ServerListener(luaListener_, "Lua"));
 
     SetupJobsEngine(unitTesting, loadJobsFromDatabase);
 
@@ -699,7 +701,7 @@
 
     // TODO REFACTOR THIS
     listeners_.clear();
-    listeners_.push_back(ServerListener(lua_, "Lua"));
+    listeners_.push_back(ServerListener(luaListener_, "Lua"));
     listeners_.push_back(ServerListener(plugins, "plugin"));
   }
 
@@ -712,7 +714,7 @@
 
     // TODO REFACTOR THIS
     listeners_.clear();
-    listeners_.push_back(ServerListener(lua_, "Lua"));
+    listeners_.push_back(ServerListener(luaListener_, "Lua"));
   }