critical impact:
pthread_get_expiration_np - not supported; temporarily available (CrUn259)
Problem description
The pthread_get_expiration_np function exists on Tru64 UNIX, but not on HP-UX. This function will be available on a temporary basis in the Tru64 UNIX Migration Environment for HP-UX.
The pthread_get_expiration_np function obtains a value representing a desired expiration time.
The Migration Environment contains Tru64 UNIX APIs, development tools, and commands and utilities to assist customers in migrating their applications from Tru64 UNIX to HP-UX. Identifiers
 pthread_get_expiration_np |
|
Old behavior
int status;
struct timespec timeout, delta = {5, 0};
pthread_get_expiration_np (&delta, &timeout);
pthread_mutex_lock (&m);
status = 0;
while (wait && status == 0)
pthread_cond_timedwait (&cond, &m, &timeout);
pthread_mutex_unlock (&m);See also
Solution description
The pthread_get_expiration_np is in the Tru64 UNIX Migration Environment.
Applications can use this routine from the Migration Environment. Note that the Migration Environment is temporary.
If your code relies on the pthread_get_expiration_np convenience routine, modify it to use the standard POSIX mechanism to compute a timeout. New behavior
#define NSECS_IN_SEC (1000 * 1000 * 1000)
int status;
struct timespec timeout, delta = {5, 0};
clock_gettime (CLOCK_REALTIME, &timeout);
timeout.tv_sec += delta.tv_sec;
timeout.tv_nsec += delta.tv_nsec;
if (timeout.tv_nsec > NSECS_IN_SEC) {
timeout.tv_nsec -= NSECS_IN_SEC;
timeout.tv_sec += 1;
}
pthread_mutex_lock (&m);
status = 0;
while (wait && status == 0)
pthread_cond_timedwait (&cond, &m, &timeout);
pthread_mutex_unlock (&m);See also
Problem summary
| classifications |
source types |
OS release |
severity |
type |
| ME, TH |
C, C++ |
any HP-UX 11i version |
critical |
unavailable |
|