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

Technical Reference: Kernel and Subsystems, Volume 1

thread_self Kernel Service

Purpose

Returns the caller's kernel thread ID.

Syntax

#include <sys/thread.h>

tid_t thread_self ()

Description

The thread_self kernel service returns the thread process ID of the calling process.

The thread_self service can also be used to check the environment that the routine is being executed in. If the caller is executing in the interrupt environment, the thread_self service returns a process ID of -1. If a routine is executing in a process environment, the thread_self service obtains the thread process ID.

Execution Environment

The thread_self kernel service can be called from either the process or interrupt environment.

Return Values

-1 Indicates that the thread_self service was called from an interrupt environment.

The thread_self service returns the thread process ID of the current process if called from a process environment.

Related Information

Process and Exception Management Kernel Services and Understanding Execution Environments in AIX 5L Version 5.2 Kernel Extensions and Device Support Programming Concepts.

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