FOR_SET_REENTRANCY

Run-Time Function: Controls the type of reentrancy protection that the Fortran Run-Time Library (RTL) exhibits. This routine can be called from a C or Fortran program.

Module: USE DFLIB

Syntax

result = FOR_SET_REENTRANCY (mode)

mode
Must be of type INTEGER(4) and contain one of the following options:


Results:

The result is of type INTEGER(4). The return value represents the previous setting of the Fortran Run-Time Library reentrancy mode, unless the argument is FOR_K_REENTRANCY_INFO, in which case the return value represents the current setting.

You must be using an RTL that supports the level of reentrancy you desire. For example, FOR_SET_REENTRANCY ignores a request for thread protection (FOR_K_REENTRANCY_THREADED) if you do not build your program with the thread-safe RTL.

Example

Consider the following:

  PROGRAM SETREENT
  USE DFLIB

  INTEGER*4    MODE
  CHARACTER*10 REENT_TXT(3) /'NONE    ','ASYNCH  ','THREADED'/

  PRINT*,'Setting Reentrancy mode to ',REENT_TXT(MODE+1)
  MODE = FOR_SET_REENTRANCY(FOR_K_REENTRANCY_NONE)
  PRINT*,'Previous Reentrancy mode was ',REENT_TXT(MODE+1)

  MODE = FOR_SET_REENTRANCY(FOR_K_REENTRANCY_INFO)
  PRINT*,'Current Reentrancy mode is ',REENT_TXT(MODE+1)

  END