IFDTHRD (HLI function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
No edit summary
m (link repair)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
The conventions used on this page are described in [[HLI: Function call list#Function call notation conventions|Function call notation conventions]].
The conventions used on this page are described in [[HLI: Function summary#Function call notation conventions|Function call notation conventions]].


==Summary==
==Summary==
Line 32: Line 32:
<tr>
<tr>
<td>NEW_ID</td>
<td>NEW_ID</td>
<td>[I,i,r] The new thread identifier is a required input parameter that identifies the thread to be made current. This is the thread identifier previously assigned by the IFSTRT or IFSTRTN call that started the thread. (See the THRD_ID parameter for [[IFSTRT call (IFAM2/IFAM4) -mc,sc|IFSTRT (IFAM2/IFAM4)]].) Specify an integer value. </td>
<td>[I,i,r] The new thread identifier is a required input parameter that identifies the thread to be made current. This is the thread identifier previously assigned by the IFSTRT or IFSTRTN call that started the thread. (See the THRD_ID parameter for [[IFSTRT (IFAM2/IFAM4) (HLI function)|IFSTRT (IFAM2/IFAM4)]].) Specify an integer value. </td>
</tr>
</tr>
<tr>
<tr>

Latest revision as of 22:55, 22 August 2016

The conventions used on this page are described in Function call notation conventions.

Summary

Description
The IFDTHRD call (DETACH THREAD) detaches the current thread and activates the specified IFSTRT thread.
Thread type
multiple cursor IFSTRT, single cursor IFSTRT
IFCALL function number
42

Syntax

IFDTHRD|IFDTRD(RETCODE,NEW_ID,OLD_ID)

Compile-only form
Not available
Execute-only form
Not available

Specify the parameters in the syntax order shown above.

Parameter Description
RETCODE [O,i,r] The Model 204 return code is a required output parameter. The code is a binary integer value.
NEW_ID [I,i,r] The new thread identifier is a required input parameter that identifies the thread to be made current. This is the thread identifier previously assigned by the IFSTRT or IFSTRTN call that started the thread. (See the THRD_ID parameter for IFSTRT (IFAM2/IFAM4).) Specify an integer value.
OLD_ID [O,i,r] The old thread identifier is a required output parameter that identifies the thread that is being detached. Model 204 returns the integer value that identifies the current thread.

Usage notes

Use the IFDTHRD call to switch from the current thread to another, while freeing the old thread. IFDTHRD entails low overhead. You cannot use IFDTHRD to detach the current thread without specifying a new thread.

Note: Update units must begin and end on the same thread. To assure that any in-progress update unit ends on the current thread, issue an IFCMMT or IFCMTR on the current thread before the call to IFDTHRD.

The IFDTHRD call is useful for switching threads in a multithreaded IFAM2 or IFAM4 transaction using single cursor IFSTRT threads. IFDTHRD is not valid for use with an IFAM1 thread.

Note: IFDTHRD is valid for use only with an IFSTRT thread. If your job started both IFSTRT and IFDIAL threads and you use the IFDTHRD call to detach threads, IFDTHRD releases an IFSTRT thread without disconnecting the IFDIAL thread.

Completion return code (RETCODE)

If the IFDTHRD call is unsuccessful, Model 204 returns one of the following error codes:

Code Error condition
95 Nonexistent new thread specified. Call ignored.
96 New thread is already the current thread and is not detached.

Coding example (COBOL)

WORKING-STORAGE SECTION. 01 ARGS-FOR-CALL. 05 RETCODE PIC 9(5) COMP SYNC. 05 NEWID PIC 9(5). 05 OLDID PIC 9(5). . . . PROCEDURE DIVISION. . . . CALL "IFDTHRD" USING RETCODE, NEWID, OLDID.