?? RIGHT := 110 ??

  PROCEDURE [INLINE] nlp$cl_initialize_template
    (    application_layer: nlt$cl_application_layer;
         layer: nlt$cl_layer_name;
         layer_connection_size: nlt$cl_layer_connection_size;
         maximum_protocol_header_size: nat$data_length;
         sap_processor: nlt$cl_event_processor;
         sap_timer_evaluator: nat$network_procedure;
         connection_processor: nlt$cl_event_processor;
         connection_timer_evaluator: nat$network_procedure);

?? PUSH (LISTEXT := ON) ??
*copy nlh$cl_initialize_template

    CONST
      successful = 0,
      failed = 1,
      locked = 2;

    VAR
      actual: string (8),
      initial: string (8),
      l: nlt$cl_layer_name,
      new: string (8),
      result: successful .. locked,
      template_p: ^nlt$cl_connection_layer_templat;

    IF NOT nlv$cl_connection_layer_templat [application_layer].path [layer] THEN
      template_p := ^nlv$cl_connection_layer_templat [application_layer];
      initial := nlc$cl_path_unlocked;
      new := nlc$cl_path_locked;
      REPEAT
        #COMPARE_SWAP (template_p^.initialization_lock, initial, new, actual, result);
        IF (result = successful) THEN
          IF NOT template_p^.path [layer] THEN
            template_p^.sap [layer].event_processor.layer := layer;
            template_p^.connection [layer].event_processor.layer := layer;
            CASE layer OF
            = nlc$xns_session_layer =
              template_p^.sap [layer].event_processor.se := sap_processor.se;
              template_p^.connection [layer].event_processor.se := connection_processor.se;
            = nlc$channel_connection_layer =
              template_p^.sap [layer].event_processor.cc := sap_processor.cc;
              template_p^.connection [layer].event_processor.cc := connection_processor.cc;
            = nlc$osi_transport_access_agent =
              template_p^.sap [layer].event_processor.ta := sap_processor.ta;
              template_p^.connection [layer].event_processor.ta := connection_processor.ta;
            = nlc$tcp_access_agent =
              template_p^.sap [layer].event_processor.tcpaa := sap_processor.tcpaa;
              template_p^.connection [layer].event_processor.tcpaa := connection_processor.tcpaa;
            ELSE
              ;
            CASEND;
            template_p^.sap [layer].timer_evaluator := sap_timer_evaluator;
            template_p^.connection [layer].description_size := layer_connection_size;
            template_p^.connection [layer].maximum_protocol_header_size := maximum_protocol_header_size;
            template_p^.path_header_size := nlv$cl_connection_layer_templat [application_layer].
                  path_header_size + maximum_protocol_header_size;
            template_p^.connection [layer].timer_evaluator := connection_timer_evaluator;
            template_p^.connection [layer].description_offset := #SIZE (nlt$cl_layer_name);
            IF (layer <> application_layer) THEN
              FOR l := application_layer TO PRED (layer) DO
                IF template_p^.path [l] THEN
                  template_p^.connection [layer].description_offset :=
                        template_p^.connection [layer].description_offset +
                        template_p^.connection [l].description_size + #SIZE (nlt$cl_layer_name);
                IFEND;
              FOREND;
            IFEND;
            template_p^.path [layer] := TRUE;
          IFEND;
          initial := nlc$cl_path_locked;
          new := nlc$cl_path_unlocked;
          REPEAT
            #COMPARE_SWAP (template_p^.initialization_lock, initial, new, actual, result);
          UNTIL (result = successful);
        IFEND;
      UNTIL (result = successful);
    IFEND;

  PROCEND nlp$cl_initialize_template;

*copyc nlv$cl_connection_layer_templat
?? POP ??
