This activity releases an exclusive lock, having the specified identifier, that was previously acquired using the MUTEX_ACQUIRE activity.  It can be used (in conjunction with the MUTEX_ACQUIRE activity) to implement "single-threaded" access to a specified "resource", or, to put it another way, to block concurrent usage of the "resource".

Executing this activity can have one of the following outcomes:

  • If the lock with the specified identifier exists and was acquired using the same processing sequence run number, then the lock will be released and the activity ends normally
  • If the lock with the specified identifier exists and *YES is specified for the FORCERELEASE parameter, then the lock will be released and the activity ends normally
  • If no lock exists with the specified identifier, then the activity ends with a warning status – this is not an error and the processing sequence will continue normally.
  • Otherwise, the activity ends in error (which your solution can handle, if you choose, with a CATCH directive).  The most usual error case is that the lock exists but was acquired using a different processing sequence run number to the current run, and *YES was not specified for the FORCERELEASE parameter.

Refer to the description of MUTEX_ACQUIRE for further important information concerning the use of this pair of activities.

LANSA Composer supplies the example Processing Sequence EXAMPLE_MUTEX01 as a simple illustration of the use of this activity.  Refer to Example Processing Sequences for information on installing and using the example Processing Sequences.  Refer to the notes attached to the EXAMPLE_MUTEX01 Processing Sequence for information on using the example.

INPUT Parameters:

LOCKID: Required

This parameter must specify the identifier for the exclusive lock to be released.  The identifier must exactly match the identifier used on the MUTEX_ACQUIRE activity when the lock was acquired.

FORCERELEASE: Optional

This parameter can be used, in exceptional circumstances, to force the release of the specified lock, even if it was acquired using a different processing sequence run number.

The default value, *NO, means that MUTEX_RELEASE will succeed only if the lock with the specified identifier exists and was acquired using the same processing sequence run number as the run in which the MUTEX_RELEASE activity is used.

If you specify *YES, and the lock with the specified identifier exists, then it will be released, even if it was acquired using a different processing sequence run number.

OUTPUT Parameters:

There are no output parameters

  • No labels