# HG changeset patch # User Alain Mazy # Date 1599655630 -7200 # Node ID 32cda90ccf0930792741f2181d79db7c1a634ad1 # Parent 1c9c2c41c0151bb44b45689aa593e56501877f44# Parent b416b6bf129b0d190214dd713f1a7400eba6d125 merge diff -r 1c9c2c41c015 -r 32cda90ccf09 OrthancServer/Plugins/Include/orthanc/OrthancCPlugin.h --- a/OrthancServer/Plugins/Include/orthanc/OrthancCPlugin.h Wed Sep 09 14:46:59 2020 +0200 +++ b/OrthancServer/Plugins/Include/orthanc/OrthancCPlugin.h Wed Sep 09 14:47:10 2020 +0200 @@ -1996,6 +1996,16 @@ * * This function registers a callback function that is called * whenever a new DICOM instance is stored into the Orthanc core. + * + * @warning Your callback function will be called synchronously with + * the core of Orthanc. This implies that deadlocks might emerge if + * you call other core primitives of Orthanc in your callback (such + * deadlocks are particular visible in the presence of other plugins + * or Lua scripts). It is thus strongly advised to avoid any call to + * the REST API of Orthanc in the callback. If you have to call + * other primitives of Orthanc, you should make these calls in a + * separate thread, passing the pending events to be processed + * through a message queue. * * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). * @param callback The callback function. @@ -3164,11 +3174,15 @@ * This function registers a callback function that is called * whenever a change happens to some DICOM resource. * - * @warning If your change 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. + * @warning Your callback function will be called synchronously with + * the core of Orthanc. This implies that deadlocks might emerge if + * you call other core primitives of Orthanc in your callback (such + * deadlocks are particular visible in the presence of other plugins + * or Lua scripts). It is thus strongly advised to avoid any call to + * the REST API of Orthanc in the callback. If you have to call + * other primitives of Orthanc, you should make these calls in a + * separate thread, passing the pending events to be processed + * through a message queue. * * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). * @param callback The callback function. @@ -7597,12 +7611,22 @@ } _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 Your callback function will be called synchronously with + * the core of Orthanc. This implies that deadlocks might emerge if + * you call other core primitives of Orthanc in your callback (such + * deadlocks are particular visible in the presence of other plugins + * or Lua scripts). It is thus strongly advised to avoid any call to + * the REST API of Orthanc in the callback. If you have to call + * other primitives of Orthanc, you should make these calls in a + * separate thread, passing the pending events to be processed + * through a message queue. + * * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). * @param callback The callback. * @return 0 if success, other value if error.