[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
Base Operating System and Extensions Technical Reference, Volume 1

pthread_suspend_np and pthread_continue_np Subroutine

Purpose

Suspends execution of the pthread specified by thread.

Library

Threads Library (libpthreads.a)

Syntax

#include <pthread.h>

int pthread_suspend_np(pthread_t thread);

int pthread_continue_np(pthread_t thread);

Description

The pthread_suspend_np routine immediately suspends the execution of the pthread specified by thread. On successful return from pthread_suspend_np, the suspended pthread is no longer executing. If pthread_suspend_np is called for a pthread that is already suspended, the pthread is unchanged and pthread_suspend_np returns successful.

The pthread_continue_np routine resumes the execution of a suspended pthread. If pthread_continue_np is called for a pthread that is not suspended, the pthread is unchanged and pthread_continue_np returns successful.

A suspended pthread will not be awakened by a signal. The signal stays pending until the execution of pthread is resumed by pthread_continue_np.

Parameters

thread Specifies the target thread.

Return Values

Zero is returned when successful. A non-zero value indicates an error.

Error Codes

If any of the following conditions occur, pthread_suspend_np and pthread_continue_np fail and return the corresponding value:

ESRCH The thread attribute cannot be found in the current process.

Implementation Specifics

This subroutine is part of the Base Operating System (BOS) Runtime.


[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]