VMS Help
POSIX Threads, PTHREAD routines, pthread_delay_np
*Conan The Librarian (sorry for the slow response - running on an old VAX)
|
|
Delays a thread's execution.
#include <pthread.h>
int
pthread_delay_np (
const struct timespec *interval);
interval
Number of seconds and nanoseconds to delay execution. The value
specified for each must be greater than or equal to zero.
This routine causes a thread to delay execution for a specific
interval of time. This interval ends at the current time plus the
specified interval. The routine will not return before the end
of the interval is reached, but may return an arbitrary amount of
time after the end of the interval is reached. This can be due to
system load, thread priorities, and system timer granularity.
Specifying an interval of zero (0) seconds and zero (0)
nanoseconds is allowed and can be used to force the thread either
to give up the processor or to deliver a pending cancelation
request.
The timespec structure contains the following two fields:
o tv_sec is an integral number of seconds.
o tv_nsec is an integral number of nanoseconds.
If an error condition occurs, this routine returns an integer
value indicating the type of error. Possible return values are as
follows:
Return Description
0 Successful completion.
[EINVAL] The value specified by interval is invalid.
[legal]
[privacy]
[GNU]
[policy]
[netiquette]
[sponsors]
[FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.