THREADID

THREADID (short for thread identifier) returns a POINTER value that is the address of the operating system thread identifier for an attached thread.
Read syntax diagramSkip visual syntax diagram
>>-THREADID--(--x--)-------------------------------------------><

x
Task reference. The value of x should have been set previously in the THREAD option of the ATTACH statement.

The value returned by this built-in function can be used to invoke system functions, such as DosSetPriority, on Windows, or posix functions on z/OS.

To obtain the system thread identifier for the currently executing thread, you must invoke the function appropriate for the platform on which that thread is running. So, on Windows, you should invoke GetCurrentThreadId, and on z/OS, you should invoke pthread_self.






Published: 23 December 2018