pthread_delay_np(3thr)pthread_delay_np(3thr)Namepthread_delay_np - Causes a thread to wait for a specified period of
time before continuing execution.
Syntax
#include <pthread.h>
int pthread_delay_np (interval)
struct timespec *interval;
Arguments
interval
Number of seconds and nanoseconds that the calling thread waits
before continuing execution. The value specified must be
greater than or equal to 0.
Description
This routine causes a 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 argument.
Specifying an interval of 0 seconds and 0 nanoseconds is allowed and
can result in the thread giving up the processor or delivering a pend‐
ing cancel.
The struct timespec structure contains two fields, as follows:
· tv.sec is an integer number of seconds, and
· tv.nsec is an integer number of nanoseconds
Return Values
If an error condition occurs, this routine returns -1 and sets errno to
the corresponding error value. Possible return values are as follows.
Return Error Description
0 Successful comple‐
tion.
-1 [EINVAL] The value specified
by interval is
invalid.
pthread_delay_np(3thr)