changeset 57:46fe70776d61

Fix possible deadlock with "orthanc.RegisterOnChangeCallback()"
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 21 Jan 2021 18:27:06 +0100
parents 23f3099bed47
children ef1a1ce0c1e3
files NEWS Sources/OnChangeCallback.cpp
diffstat 2 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Wed Jan 06 18:17:53 2021 +0100
+++ b/NEWS	Thu Jan 21 18:27:06 2021 +0100
@@ -1,6 +1,8 @@
 Pending changes in the mainline
 ===============================
 
+* Fix possible deadlock with "orthanc.RegisterOnChangeCallback()"
+
 
 Version 3.0 (2020-12-09)
 ========================
--- a/Sources/OnChangeCallback.cpp	Wed Jan 06 18:17:53 2021 +0100
+++ b/Sources/OnChangeCallback.cpp	Thu Jan 21 18:27:06 2021 +0100
@@ -70,6 +70,8 @@
 
 
 
+// This corresponds to a simplified, standalone version of
+// "Orthanc::SharedMessageQueue" from the Orthanc framework
 class PendingChanges : public boost::noncopyable
 {
 private:
@@ -181,11 +183,7 @@
                                                OrthancPluginResourceType resourceType,
                                                const char* resourceId)
 {
-  {
-    PythonLock lock;
-    pendingChanges_.Enqueue(changeType, resourceType, resourceId);
-  }
-  
+  pendingChanges_.Enqueue(changeType, resourceType, resourceId);
   return OrthancPluginErrorCode_Success;
 }