LOGICAL FUNCTION DCLEXH(exhandler) C C----------------------------------------- C C Author :- J.Huber 14-FEB-1991 C C========================================= C C Purpose : Declare standard exit-handler for image C Inputs : C Outputs : C C========================================= C + C Declarations. C - IMPLICIT NONE EXTERNAL exhandler INCLUDE '($SSDEF)' * EXIT HANDLER descriptor block STRUCTURE /DESBLK_EXH/ INTEGER*4 Link INTEGER*4 exh_addr INTEGER*4 narg INTEGER*4 cond_addr END STRUCTURE INTEGER exit_cond RECORD /DESBLK_EXH/ DesExh COMMON /DESEXH/ exit_cond, DesExh CHARACTER*80 message LOGICAL SYS$DCLEXH,SYS$CANEXH,Cond INTEGER CANEXH DesExh.link = 0 DesExh.exh_addr = %LOC(EXHANDLER) DesExh.narg = 0 DesExh.cond_addr = %LOC(exit_cond) Cond = SYS$DCLEXH(%REF(DesExh)) IF (.NOT.cond) THEN CALL LIB$put_output('Establishing exit handler...') CALL LIB$SYS_GETMSG(cond,,message) CALL LIB$put_output(message) CALL LIB$stop(%VAL(cond)) ENDIF DCLEXH = cond RETURN ENTRY CANEXH() Cond = SYS$CANEXH(%REF(DesExh)) IF (.NOT.cond) THEN CALL LIB$PUT_OUTPUT('Error when canceling exit handler...') CALL LIB$SYS_GETMSG(cond,,message) CALL LIB$PUT_OUTPUT(message) ENDIF CANEXH = cond END C SUBROUTINE EXHANDLER() C IMPLICIT NONE **** this example does nothing , something could be done like this: * Free event evtl. locked * CALL monitor$free_event * remove process_id from active list in monitor_share * IF (process.index .NE. 0) THEN * monitor_task_id(process.index)=0 * IF (process.quorum .GT. 0) THEN * don't longer count the exiting process for barrier quorum * CALL PPL$ADJUST_QUORUM(BARRIER_ID,-1) * process.quorum=0 * ENDIF * ENDIF * process.index=0 C END