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

pthread_delay_np Subroutine

Purpose

Causes a thread to wait for a specified period.

Library

Threads Library (libpthreads.a)

Syntax

#include <pthread.h>
int pthread_delay_np (interval)
struct timespec *interval;

Description

The pthread_delay_np subroutine causes the calling thread to delay execution for a specified period of elapsed wall clock time. The period of time the thread waits is at least as long as the number of seconds and nanoseconds specified in the interval parameter.

Notes:
  1. 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.
  2. The pthread_delay_np subroutine is not portable.

Parameters

interval Points to the time structure specifying the wait period.

Return Values

Upon successful completion, 0 is returned. Otherwise, an error code is returned.

Error Codes

The pthread_delay_np subroutine is unsuccessful if the following is true:

EINVAL The interval parameter is not valid.

Implementation Specifics

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

This subroutine is not POSIX compliant and is provided only for compatibility with DCE threads. It should not be used when writing new applications.

Related Information

The sleep, nsleep, or usleep subroutine.


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