changeset 4179:669f588a14b3

warn about possible deadlocks
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 08 Sep 2020 07:42:47 +0200
parents 8f0de3998a59
children ee9b2e2c7e19
files OrthancServer/Plugins/Include/orthanc/OrthancCPlugin.h
diffstat 1 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancServer/Plugins/Include/orthanc/OrthancCPlugin.h	Thu Sep 03 11:41:30 2020 +0200
+++ b/OrthancServer/Plugins/Include/orthanc/OrthancCPlugin.h	Tue Sep 08 07:42:47 2020 +0200
@@ -1996,6 +1996,11 @@
    *
    * This function registers a callback function that is called
    * whenever a new DICOM instance is stored into the Orthanc core.
+   *
+   * @warning If your callback has to call the REST API of Orthanc,
+   * you should make these calls in a separate thread (with the events
+   * passing through a message queue). Otherwise, this could result in
+   * deadlocks in the presence of other plugins or Lua scripts.
    * 
    * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
    * @param callback The callback function.
@@ -7597,12 +7602,18 @@
   } _OrthancPluginIncomingDicomInstanceFilter;
 
   /**
-   * @brief Register a callback to filter incoming DICOM instance.
+   * @brief Register a callback to filter incoming DICOM instances.
    *
    * This function registers a custom callback to filter incoming
    * DICOM instances received by Orthanc (either through the REST API
    * or through the DICOM protocol).
    *
+   * @warning If your filter callback has to call the REST API of
+   * Orthanc, you should make these calls in a separate thread (with
+   * the events passing through a message queue). Otherwise, this
+   * could result in deadlocks in the presence of other plugins or Lua
+   * scripts.
+   *
    * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
    * @param callback The callback.
    * @return 0 if success, other value if error.