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

Technical Reference: Base Operating System and Extensions, Volume 1

pthread_equal Subroutine

Purpose

Compares two thread IDs.

Library

Threads Library (libpthreads.a)

Syntax

#include <pthread.h>

int pthread_equal (thread1, thread2)
pthread_t thread1;
pthread_t thread2;

Description

The pthread_equal subroutine compares the thread IDs thread1 and thread2. Since the thread IDs are opaque objects, it should not be assumed that they can be compared using the equality operator (==).

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.

Parameters

thread1 Specifies the first ID to be compared.
thread2 Specifies the second ID to be compared.

Return Values

The pthread_equal function returns a nonzero value if thread1 and thread2 are equal; otherwise, zero is returned.

If either thread1 or thread2 are not valid thread IDs, the behavior is undefined.

Related Information

The pthread_self (pthread_self Subroutine) subroutine, the pthread_create (pthread_create 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 ]