.MCALL .MODULE .MODULE ITLOCK,VERSION=04,COMMENT=,IDENT=No,LIB=Yes ; Copyright (c) 1998 by Mentec, Inc., Nashua, NH. ; All rights reserved ; ; This software is furnished under a license for use only on a ; single computer system and may be copied only with the ; inclusion of the above copyright notice. This software, or ; any other copies thereof, may not be provided or otherwise ; made available to any other person except for use on such ; system and to one who agrees to these license terms. Title ; to and ownership of the software shall at all times remain ; in Mentec, Inc. ; ; The information in this document is subject to change without ; notice and should not be construed as a commitment by Digital ; Equipment Corporation, or Mentec, Inc. ; ; Digital and Mentec assume no responsibility for the use or ; reliability of its software on equipment which is not supplied ; by Digital or Mentec, and listed in the Software Product ; Description. .SBTTL Module Declarations .NLIST .ENABL LC .DSABL GBL .NLIST CND .LIST ; ++ ; FACILITY: ; ; RT-11 System Subroutine Library ; ; ENVIRONMENT: ; ; This routine can be used by any job running concurrently in ; a multi-job environment. ; ; INCLUDE FILES: ; ; SYSMAC.SML ; RT-11 system macro library. .MCALL .TLOCK ; TLOCK programmed request. ; ; EXTERNAL REFERENCES: ; .GLOBL $ERRP0 ; Entry point to EMT error conversion routine. .GLOBL $SYSLB ; Include system library work area. .SBTTL ITLOCK - Fortran-callable Routine ; ++ ; FUNCTIONAL DESCRIPTION: ; ; The ITLOCK function is used in a multi-job environment to attempt ; to gain ownership of the USR. It is similar to LOCK in that, if ; successful, the calling job returns with the USR in memory. However, ; if a job attempts to LOCK the USR while another job is using it, the ; requesting job is suspended until the USR is free. With ITLOCK, if ; the USR is not available, control returns immediately and the lock ; failure is indicated. ; ; CALLING SEQUENCE: ; ; i = ITLOCK( ) ; ; OUTPUT PARAMETERS: ; ; R0 - USR lock status ; ; RETURNED FUNCTION VALUE: ; ; 0 - no error locking USR access for current job ; 1 - USR is already in use ; ; -- .PSECT SYS$I ITLOCK:: .TLOCK ; Attempt to lock USR for exclusive access ; and use by calling job. CALLR $ERRP0 ; Get and convert any errors (status in R0) ; and return to caller with status in R0. .END