1 |
/* Acquire a rwlock for writing. Generic version. |
/* Acquire a rwlock for writing. Generic version. |
2 |
Copyright (C) 2002 Free Software Foundation, Inc. |
Copyright (C) 2002, 2005 Free Software Foundation, Inc. |
3 |
This file is part of the GNU C Library. |
This file is part of the GNU C Library. |
4 |
|
|
5 |
The GNU C Library is free software; you can redistribute it and/or |
The GNU C Library is free software; you can redistribute it and/or |
22 |
|
|
23 |
#include <pt-internal.h> |
#include <pt-internal.h> |
24 |
|
|
|
int |
|
|
pthread_rwlock_timedwrlock (struct __pthread_rwlock *rwlock, |
|
|
const struct timespec *abstime) |
|
|
{ |
|
|
return __pthread_rwlock_timedwrlock_internal (rwlock, abstime); |
|
|
} |
|
|
|
|
25 |
/* Acquire RWLOCK for writing blocking until *ABSTIME if we cannot get |
/* Acquire RWLOCK for writing blocking until *ABSTIME if we cannot get |
26 |
it. As a special GNU extension, if ABSTIME is NULL then the wait |
it. As a special GNU extension, if ABSTIME is NULL then the wait |
27 |
shall not time out. */ |
shall not time out. */ |
45 |
|
|
46 |
/* The lock is busy. */ |
/* The lock is busy. */ |
47 |
|
|
48 |
|
if (abstime && (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000)) |
49 |
|
return EINVAL; |
50 |
|
|
51 |
self = _pthread_self (); |
self = _pthread_self (); |
52 |
|
|
53 |
/* Add ourselves to the queue. */ |
/* Add ourselves to the queue. */ |
86 |
|
|
87 |
return 0; |
return 0; |
88 |
} |
} |
89 |
|
|
90 |
|
int |
91 |
|
pthread_rwlock_timedwrlock (struct __pthread_rwlock *rwlock, |
92 |
|
const struct timespec *abstime) |
93 |
|
{ |
94 |
|
return __pthread_rwlock_timedwrlock_internal (rwlock, abstime); |
95 |
|
} |