         << LINES .001/.009 ARE RESERVED FOR SYSTEMS INTEGRATION >>     00000001
                                                               <<02555>>00676000
$INCLUDE INCLJDT                                               <<02555>>00677000
procedure remove'from'xdd(xdd'index,cisession);                <<S1014>>01556000
   value xdd'index,cisession;                                  <<S1014>>01557000
   logical xdd'index,cisession;                                <<S1014>>01558000
   option external;                                            <<S1014>>01559000
PROCEDURE FBREAK;                                              <<G9903>>02206000
   OPTION EXTERNAL;                                            <<G9903>>02207000
                                                               <<G9903>>02208000
    FCLOSE,FFILEINFO,GETJCW,LOADPROC,UNLOADPROC;   <<01549>>   <<G1332>>02375000
                                                               <<.1511>>02741100
INTEGER PROCEDURE AS'DSPLABEL (PLABEL'INDX);                   <<.1511>>02741200
VALUE PLABEL'INDX;                                             <<.1511>>02741300
INTEGER PLABEL'INDX;                                           <<.1511>>02741400
OPTION EXTERNAL;                                               <<.1511>>02741500
$PAGE "PROCEDURE CLEANUPFILES"                                 <<.1511>>02744990
       TEMPA (0:JDT'TFNAME'MAX-1) = Q;                         <<02555>>02885000
       FDESIGN (0:JDT'TFNAME'MAX*2) = Q;                       <<02555>>02910000
    DISAPROC;   <<PSUEDO DISABLE>>                             <<S9488>>03660000
    DISABLE;    <<DISABLE THE INTERUPT>>                       <<S9488>>03702000
         THEN                                                  <<g9165>>03791000
     BEGIN                                                     <<g9165>>03791100
     << ------------------------------------------------ >>    <<g9165>>03792000
     << Check if the father is in mourning first...      >>    <<g9165>>03793000
     << ------------------------------------------------ >>    <<g9165>>03794000
     IF LOGICAL(SYS'PCB(FAPT+WAKEMASKWORDNUM)).MOURNWAITFLAG   <<g9165>>03794100
       THEN AWAKE(FAPT,%4000,0)                                <<S9488>>03794200
     ELSE AWAKE( FAPT,2,0);                                    <<g9165>>03795000
     END;                                                      <<g9165>>03796000
    ENABLE;     <<ENABLE THE INTERUPT>>                        <<S9488>>03797000
        ENAPROC  <<DO NOTHING>>                                <<S9488>>03810000
        ELSE ENAPROC;                                          <<S9488>>03815000
    DISAPROC;                                                  <<S9488>>03820000
    ENAPROC;                                                   <<S9488>>03860000
         WHILE NOT PIINFO.DEADFLAG DO                          <<S9488>>04115000
         WAIT(%4000,0);                                        <<S9488>>04116000
         COMMENT *** The above code is to prevent the case     <<S9488>>04117000
         where the FATHER can be waken up by a different SON   <<S9488>>04118000
         from MOURNING WAIT, then go ahead and BURRY the wrong <<S9488>>04119000
         SON;                                                  <<S9488>>04120000
$EDIT VOID=04194125  <<PROCEDURE AS'DSPLABEL DELETION>>        <<.1511>>04191275
   EQUATE DSCLEANUPJOB'INDX = 27;                               << DS >>04930625
      CREATES := JITNUMCREATIONS;                              <<H1847>>05440000
                                                                << DS >>05850250
<< HAVE ONENET CLEAN UP >>                                      << DS >>05850500
                                                                << DS >>05850750
   TOS := AS'DSPLABEL ( DSCLEANUPJOB'INDX );                    << DS >>05851000
   ASSEMBLE(TEST);                                              << DS >>05851250
   IF = THEN                                                    << DS >>05851500
      DEL   << NO ONENET >>                                     << DS >>05851750
   ELSE                                                         << DS >>05852000
      ASSEMBLE(PCAL 0);   << ONENET INSTALLED >>                << DS >>05852250
      INTEGER CI'PIN;                                          <<S1014>>07176000
      INTEGER TIP'LDEV;                                        <<S1014>>07177000
      INTEGER SAVE'LDT'SIR;                                    <<S1014>>07178000
      LOGICAL SESSION'NBR;                                     <<S1014>>07179000
      LOGICAL XDD'HEAD'INDEX;                                  <<S1014>>07179100
      INTEGER POINTER SYSGLOBX = %377;                          << DS >>07243416
      EQUATE SOCKEXPIRE'PLABEL = %131;                          << DS >>07243500
      EQUATE DSEXPIRE'INDX     = 26; << ONENET PROCESS CLEANUP ><< DS >>07243583
      INTEGER PLABEL,PROCID;                                   <<G1332>>07261000
      BYTE ARRAY PROCNAME(0:20);                               <<G1332>>07262000
                                                               <<G1332>>07537000
<< @@@@@ The following fix is added here for support @@@@@ >>  <<G1332>>07537100
<< @@@@@ of the PC Central project.                  @@@@@ >>  <<G1332>>07537200
                                                               <<G1332>>07537300
      PXFIXED;    << PCC TERMINATION >>                        <<G1332>>07537400
      IF PXFXPCDST<>0 THEN                                     <<G1332>>07537500
        BEGIN                                                  <<G1332>>07537600
        MOVE PROCNAME:="PCTERMINATE ";                         <<G1332>>07537700
        PROCID:=LOADPROC(PROCNAME,0,PLABEL);                   <<G1332>>07537800
        IF = THEN                                              <<G1332>>07537900
           BEGIN                                               <<G1332>>07538000
           TOS:=PLABEL;                                        <<G1332>>07538100
           ASSEMBLE (PCAL 0);                                  <<G1332>>07538200
           UNLOADPROC(PROCID);                                 <<G1332>>07538300
           END;                                                <<G1332>>07538400
        END;                                                   <<G1332>>07538500
                                                               <<G1332>>07538600
$EDIT VOID=7695000                                             <<01492>>07610000
$EDIT VOID = 7810000                                           <<G9903>>07755000
COMMENT****                                                    <<G9903>>07811000
 The following code has been modified to handle break while    <<G9903>>07811100
 terminating. The theoretical idea is to place an FUNBREAK call<<G9903>>07811200
 at this point in case the process tree's control block for    <<G9903>>07811300
 $stdin is in break.  This was what was done originally.       <<G9903>>07811400
 However,there was a problem if a DSline was disconnected while<<G9903>>07811500
 in break.  The problem was that an FUNBREAK was done and no   <<G9903>>07811600
 FBREAK preceded it.  This is a problem because pins get wiped <<G9903>>07811700
 out that weren't saved, and procs get lost forever.  The fix  <<G9903>>07811800
 for this was to not call FUNBREAK if the lpdt break bit was on<<G9903>>07811900
 and the CI break flag in the pxfixed area of the umain stack  <<G9903>>07812000
 was off.This fix solved that problem, but uncovered a new one.<<G9903>>07812100
 The new problem is that if break is hit and the son puts the  <<G9903>>07812200
 control block for $stdin into break mode and the umain aborts <<G9903>>07812300
 because of an abortjob, the CI never calls FUNBREAK, the son  <<G9903>>07812400
 stays impeded and the main stays in mourning.                 <<G9903>>07812500
    The file system lab believes that although calling         <<G9903>>07812600
 FUNBREAK twice is a problem, and calling FUNBREAK with no     <<G9903>>07812700
 matching FBREAK is a problem, calling FBREAK twice is not a   <<G9903>>07812800
 problem, because the second FBREAK will see the break has     <<G9903>>07812900
 already been done.  Therefore, it shouldn't hurt to do an     <<G9903>>07813000
 FBREAK and FUNBREAK call in a row at this point.  This should <<G9903>>07813100
 clear any control block lockups due to hitting break.         <<G9903>>07813200
;                                                              <<G9903>>07813300
             FBREAK;                                           <<G9903>>07815000
             FUNBREAK(TRUE);                                   <<G9903>>07820000
$EDIT                                                          <<09774>>07905000
                                                               <<09774>>07905250
      UNLOAD(PIN);                    <<UNLOADS THE PROGRAM>>  <<09774>>08045100
      IF SYSGLOBX(SOCKEXPIRE'PLABEL) <> 0 THEN                  << DS >>08045250
         BEGIN   << CALL SOCKETS TO CLEAN UP >>                 << DS >>08045375
         TOS := SYSGLOBX(SOCKEXPIRE'PLABEL);                    << DS >>08045500
         ASSEMBLE(PCAL 0);                                      << DS >>08045625
         END;                                                   << DS >>08045750
      TOS := AS'DSPLABEL ( DSEXPIRE'INDX );  << CHECK FOR DS >> << DS >>08045875
      ASSEMBLE(TEST);                                           << DS >>08046000
      IF = THEN                                                 << DS >>08046125
         DEL                                                    << DS >>08046250
      ELSE                                                      << DS >>08046375
         BEGIN   << ONENET ON SYSTEM; CALL TO CLEAN UP >>       << DS >>08046500
         TOS := PIN;                                            << DS >>08046625
         ASSEMBLE(XCH; PCAL 0);                                 << DS >>08046750
         END;                                                   << DS >>08046875
      ABORTPROCIO(PIN);  <<ABORT I/O FOR MAIN PIN>>            <<*1546>>08076000
                                                               <<S1014>>08660900
$EDIT VOID=8722000                                             <<01493>>08661000
                                                               <<01493>>08665000
      EXCHANGEDB(LDT'DST);                                     <<01493>>08670000
      LDT'INDEX := LDEV * SIZE'OF'LDT'ENTRY;                   <<01493>>08675000
      DEVTYPE := LDT'DEVICE'TYPE;                              <<01493>>08680000
                                                               <<01493>>08685000
      IF JOBTYPE = SESSION  AND  LDT'CONTROL'Y'PIN = PIN THEN  <<01493>>08690000
        BEGIN  << CLEAN UP CONTROL Y FOR SESSIONS >>           <<01493>>08695000
          LDT'CONTROL'Y'PIN := 0;                              <<01493>>08700000
          IF DEVTYPE=TERM THEN IOCONTROL(LDEV,12);             <<01493>>08705000
                                  << DISABLE CY >>             <<01493>>08706000
        END;                                                   <<01493>>08710000
                                                               <<01493>>08715000
      EXCHANGEDB(0);                                           <<01493>>08720000
      <<THIS IS THE BEST PLACE TO PUT THE MI CODE BECAUSE WE>> <<E2281>>08741000
      <<DO NOT CARE ABOUT TIME SPEND ON CLEANUPJOB FOR C.I. >> <<E2281>>08741100
      PXFIXED;                                                 <<E2281>>08741200
      IF PXFXPCLSMASK <> 0 THEN  <<MI DATA STRUCTURE CLEAN UP>><<E2281>>08741300
         STOPSTATISTICS(PXFXPCLSMASK);                         <<E2281>>08741400
                                                               <<E2281>>08741500
      SIRCOND := GETSIR(MEASSIR);                              <<E2281>>08741600
      IF GCLASSENABLEDMASK.CLASS15 THEN                        <<E2281>>08741700
         BEGIN  <<PROCESS INTRUMENTATION ENABLED>>             <<E2281>>08741800
           TOS := MEASPROCXDSBANK;                             <<E2281>>08741900
           TOS := MEASPROCXDSBASE;                             <<E2281>>08742000
           ASSEMBLE(LSEA);                                     <<E2281>>08742100
           TOS:= TOS * PIN;                                    <<E2281>>08742200
           ASSEMBLE(LADD);  <<POINT TO THE PROC ENTRY>>        <<E2281>>08742300
           TOS := TOS + LOGICAL(CP'TERMINATETIME);             <<E2281>>08742400
           TOS := TIMER;                                       <<E2281>>08742500
           ASSEMBLE(SDEA); <<RECORD THE PROC TERMINATION TIME>><<E2281>>08742600
           DDEL;                                               <<E2281>>08742700
         END;                                                  <<E2281>>08742800
      RELSIR(MEASSIR,SIRCOND);                                 <<E2281>>08742900
$EDIT VOID=8991800                                             <<E2281>>08990000
