[Return to Bookshelf] [Contents] [Previous Section] [Next Section] [Index] [Help]


pthread_delay_np

Causes a thread to delay execution.

Syntax

pthread_delay_np(
                 interval );
 


Argument Data Type Access

interval struct timespec read


C Binding

extern int
pthread_delay_np (
struct timespec *interval);

Arguments

interval
Number of seconds and nanoseconds to delay execution. The value specified for each must be greater than or equal to zero.

Description

This routine causes a thread to delay execution for a specific period of time. This period ends at the current time plus the specified interval. The thread will not return before the end of the period is reached.

Specifying an interval of 0 seconds and 0 nanoseconds is allowed and can result in the thread giving up the processor or delivering a pending cancel.

The struct timespec structure contains the following two fields:

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 completion. -1 [EINVAL] The value specified by interval is invalid.



[Return to Bookshelf] [Contents] [Previous Section] [Next Section] [Index] [Help]