FreeBSD/sys/dev/isci/scil/scic_sds_remote_node_context.c
/**
* This method just calls the user callback function and then resets the
* callback.
*
* @param[in out] rnc
*/
This method just calls the user callback function and then resets the
callback.
This method just calls the user callback function and then resets the callback .
static
void scic_sds_remote_node_context_notify_user(
   SCIC_SDS_REMOTE_NODE_CONTEXT_T *rnc
)
{
   SCIC_SDS_REMOTE_NODE_CONTEXT_CALLBACK local_user_callback = rnc->user_callback;
   void * local_user_cookie = rnc->user_cookie;
   rnc->user_callback = NULL;
   rnc->user_cookie = NULL;
   if (local_user_callback != NULL)
   {
      (*local_user_callback)(local_user_cookie);
   }
}
static void scic_sds_remote_node_context_notify_user ( SCIC_SDS_REMOTE_NODE_CONTEXT_T * rnc ) { SCIC_SDS_REMOTE_NODE_CONTEXT_CALLBACK local_user_callback = rnc -> user_callback ; void * local_user_cookie = rnc -> user_cookie ; rnc -> user_callback = NULL ; rnc -> user_cookie = NULL ; if ( local_user_callback != NULL ) { ( * local_user_callback ) ( local_user_cookie ) ; } }
This method just calls the user callback function and then resets the
callback.
This method just calls the user callback function and then resets the callback .
//we need to set the user_callback to NULL before it is called, because //the user callback's stack may eventually also set up a new set of //user callback. If we nullify the user_callback after it is called, //we are in the risk to lose the freshly set user callback.