BPX1PTC (pthread_create) example
The following code creates a new thread. For the callable
service, see pthread_cancel (BPX1PTB, BPX4PTB) — Cancel a thread. For the data structure,
see BPXYPTAT — Map attributes for pthread_exit_and_get. AMODE
64 callers use BPX4PTC (pthread_create) example.
LA R15,BUFFERA Work area
ST R15,BUFA ->above
LA R15,PTAT Area mapped by BPXYPTAT
ST R15,PTATA ->above
MVC PTATEYE,=C'BPXYPTAT' Set the eye-catcher
MVC PTATLENGTH,=A(PTATUSEROFFVAL) Length of structure
MVC PTATSYSOFFSET,=A(PTATSYSOFFVAL) Sys attr offset
MVC PTATSYSLENGTH,=A(PTATSYSLENVAL) Sys attr length
MVC PTATUSEROFFSET,=A(0) User attr offset
MVC PTATUSERLENGTH,=A(0) User attr length
LOAD EP=INITRTN Get address of Init Rtn
ST R0,INITRTNA
SPACE ,
CALL BPX1PTC, +
(INITRTNA, Input: Init routine address +
BUFA, Input: Work area address +
PTATA, Input: Attr area Address BPXYPTAT +
THID, Thread ID, if Return value = 0 +
RETVAL, Return value: 0 or -1 +
RETCODE, Return code +
RSNCODE), Reason code +
VL,MF=(E,PLIST) ----------------------------------