1 |
/* Acquire a rwlock for reading. Generic version. |
/* Acquire a rwlock for reading. 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_timedrdlock (struct __pthread_rwlock *rwlock, |
|
|
const struct timespec *abstime) |
|
|
{ |
|
|
return __pthread_rwlock_timedrdlock_internal (rwlock, abstime); |
|
|
} |
|
|
|
|
25 |
/* Acquire the rwlock *RWLOCK for reading blocking until *ABSTIME if |
/* Acquire the rwlock *RWLOCK for reading blocking until *ABSTIME if |
26 |
it is already held. As a GNU extension, if TIMESPEC is NULL then |
it is already held. As a GNU extension, if TIMESPEC is NULL then |
27 |
wait forever. */ |
wait forever. */ |
59 |
/* Better be blocked by a writer. */ |
/* Better be blocked by a writer. */ |
60 |
assert (rwlock->readers == 0); |
assert (rwlock->readers == 0); |
61 |
|
|
62 |
|
if (abstime && (abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000)) |
63 |
|
return EINVAL; |
64 |
|
|
65 |
self = _pthread_self (); |
self = _pthread_self (); |
66 |
|
|
67 |
/* Add ourself to the queue. */ |
/* Add ourself to the queue. */ |
104 |
|
|
105 |
return 0; |
return 0; |
106 |
} |
} |
107 |
|
|
108 |
|
int |
109 |
|
pthread_rwlock_timedrdlock (struct __pthread_rwlock *rwlock, |
110 |
|
const struct timespec *abstime) |
111 |
|
{ |
112 |
|
return __pthread_rwlock_timedrdlock_internal (rwlock, abstime); |
113 |
|
} |