[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 1

pthread_self Subroutine

Purpose

Returns the calling thread's ID.

Library

Threads Library (libpthreads.a)

Syntax

#include <pthread.h>

pthread_t pthread_self (void);

Description

The pthread_self subroutine returns the calling thread's ID.

Note
The pthread.h header file must be the first included file of each source file using the threads library. Otherwise, the -D_THREAD_SAFE compilation flag should be used, or the cc_r compiler used. In this case, the flag is automatically set.

Return Values

The calling thread's ID is returned.

Errors

No errors are defined.

The pthread_self function will not return an error code of EINTR.

Related Information

The pthread_create (pthread_create Subroutine) subroutine, pthread_equal (pthread_equal Subroutine) subroutine.

The pthread.h file.

Creating Threads in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.

Threads Library Quick Reference in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]