# HG changeset patch # User Sebastien Jodogne # Date 1599549393 -7200 # Node ID b416b6bf129b0d190214dd713f1a7400eba6d125 # Parent ee9b2e2c7e19d24dd54b967c2cd5010c149d5ed4 clarification of sdk doc about deadlocks diff -r ee9b2e2c7e19 -r b416b6bf129b OrthancServer/Plugins/Include/orthanc/OrthancCPlugin.h --- a/OrthancServer/Plugins/Include/orthanc/OrthancCPlugin.h Tue Sep 08 07:43:07 2020 +0200 +++ b/OrthancServer/Plugins/Include/orthanc/OrthancCPlugin.h Tue Sep 08 09:16:33 2020 +0200 @@ -1997,10 +1997,15 @@ * 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. + * @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. @@ -3169,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. @@ -7608,12 +7617,16 @@ * 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. - * + * @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.