Releasing the resource

Use the RELEASE request to release a serially reusable resource that you obtained by using ISGENQ macro. If a task tries to release a resource which it does not control, the control program either returns a non-zero return code or abends the task. The control program might place many tasks in a wait condition while it assigns control of the resource to one task. Having many tasks in the wait state might reduce the amount of work being done by the system, therefore, you should release the resource, so that another task can use it.

If a task terminates without releasing a resource, the control program releases the resource automatically. By default, outstanding ENQs have affinity to the task that issued the ENQ. The system releases any outstanding ENQs during termination as follows: