Index of Section 2 Manual Pages
| Interix / SUA | pthread_rwlock_timedwrlock.2 | Interix / SUA |
pthread_rwlock_timedwrlock(2) pthread_rwlock_timedwrlock(2)
pthread_rwlock_timedwrlock()
NAME
pthread_rwlock_timedwrlock() - lock a read-write lock for writing with
expiration time
SYNOPSIS
#include
int pthread_rwlock_timedwrlock(pthread_rwlock_t *lock,
const struct timespec *abstime);
DESCRIPTION
The pthread_rwlock_timedrdlock(2) function acquires a write lock on the
read-write lock object referenced by the lock object. If the read-write
lock object is already locked for reading or writing, the calling thread
is blocked until the lock object becomes available, as with the
pthread_rwlock_wrlock(2) function. If the lock object cannot be locked
because another thread has a read or write lock on the lock object, the
block ends when the system clock reaches the time referenced by the
abstime argument, or if the time has already passed when the call is made.
If a thread is blocked waiting to acquire a write lock and receives a
signal, the thread resumes waiting after the signal handler returns, as
though the signal had not been received.
RETURN VALUES
On success, the function returns 0; otherwise, an error code is returned.
ERRORS
The pthread_rwlock_timedwrlock() function can fail for the following
reasons:
[EDEADLK]
The calling thread already has a lock on the specified read-write lock
object.
[EINVAL]
The lock argument does not refer to a valid read-write lock object, or
the abstime argument specifies a value in nanoseconds less than zero
or greater than or equal to 1000 million.
[ETIMEDOUT]
A lock could not be obtained before the specified time was reached.
This function does not return [EINTR].
SEE ALSO
pthread_rwlock_destroy(2)
pthread_rwlock_rdlock(2)
pthread_rwlock_timedrdlock(2)
pthread_rwlock_tryrdlock(2)
pthread_rwlock_trywrlock(2)
pthread_rwlock_unlock(2)
pthread_rwlock_wrlock(2)
time(2)
USAGE NOTES
The pthread_rwlock_timedwrlock function is thread safe.
The pthread_rwlock_timedwrlock function is not async-signal safe.