?? PUSH (LISTEXT := ON) ??
*copyc dfv$ch_queue_entry_location

{ PURPOSE:
{   This procedure is a cleanup routine to clear the assignment of a task services queue_entry if a task
{   aborts with a queue_entry assigned to it.  The queue_entry must be clear before the task can safely exit.
{   This procedure is called by the condition handler defined by the user, and which is contained in the
{   procedure which must handle unexpected conditions.

    PROCEDURE dfp$ch_cleanup;

      VAR
        ignore_status: ost$status;

{ If this task is terminating (or encountered something unexpected), release the queue_entry assignment if it
{ is assigned.

      IF dfv$ch_queue_entry_location <> 1 THEN
        dfp$end_remote_procedure_call (dfv$ch_queue_entry_location, ignore_status);
        dfv$ch_queue_entry_location := 1;
        #SPOIL (dfv$ch_queue_entry_location);
      IFEND;

    PROCEND dfp$ch_cleanup;
?? POP ??

    PROCEDURE [INLINE] dfp$begin_ch_remote_proc_call
      (    server_location: dft$server_location;
           allowed_when_server_deactivated: boolean;
       VAR queue_entry_location: dft$rpc_queue_entry_location;
       VAR p_send_to_server_params: dft$p_send_parameters;
       VAR p_send_data: dft$p_send_data;
       VAR status: ost$status);

{ NOTE: A condition handler with the name DFP$REMOTE_PROCEDURE_CALL_CH must be defined in the procedure which
{ declares this procedure (DFP$BEGIN_CH_REMOTE_PROC_CALL).  The condition handler must make a call to the
{ nested procedure DFP$CH_CLEANUP (declared as part of this common deck).  The following is an example of the
{ condition handler:
{
{   PROCEDURE dfp$remote_procedure_call_ch
{     (    condition: pmt$condition;
{          condition_descriptor: ^pmt$condition_information;
{          save_area: ^ost$stack_frame_save_area;
{      VAR handler_status: ost$status);
{
{     dfp$ch_cleanup;
{     EXIT <procedure declaring this condition handler>;
{
{   PROCEND dfp$remote_procedure_call_ch;

?? PUSH (LISTEXT := ON) ??

      status.normal := TRUE;
      dfv$ch_queue_entry_location := 1; {Real entry can never be 1, since it is reserved for the poll task}
      #SPOIL (dfv$ch_queue_entry_location);
      osp$establish_condition_handler (^dfp$remote_procedure_call_ch, TRUE);
      dfp$begin_remote_procedure_call (server_location, allowed_when_server_deactivated, queue_entry_location,
            p_send_to_server_params, p_send_data, status);
      IF NOT status.normal THEN
        osp$disestablish_cond_handler;
      ELSE
        #SPOIL (dfv$ch_queue_entry_location);
        dfv$ch_queue_entry_location := queue_entry_location;
        #SPOIL (dfv$ch_queue_entry_location);
      IFEND;

    PROCEND dfp$begin_ch_remote_proc_call;

*copyc dfp$begin_remote_procedure_call
*copyc dft$rpc_parameters
*copyc dft$rpc_queue_entry_location
*copyc dft$server_location
*copyc dft$server_location_selector
*copyc osp$establish_condition_handler
*copyc osp$disestablish_cond_handler
*copyc ost$status
?? POP ??
