| 503 | } |
| 504 | |
| 505 | static int pthread_rwlock_timedrdlock(pthread_rwlock_t *l, const struct timespec *ts) |
| 506 | { |
| 507 | unsigned long long ct = _pthread_time_in_ms(); |
| 508 | unsigned long long t = _pthread_time_in_ms_from_timespec(ts); |
| 509 | |
| 510 | pthread_testcancel(); |
| 511 | |
| 512 | /* Use a busy-loop */ |
| 513 | while (1) |
| 514 | { |
| 515 | /* Try to grab lock */ |
| 516 | if (!pthread_rwlock_tryrdlock(l)) return 0; |
| 517 | |
| 518 | /* Get current time */ |
| 519 | ct = _pthread_time_in_ms(); |
| 520 | |
| 521 | /* Have we waited long enough? */ |
| 522 | if (ct > t) return ETIMEDOUT; |
| 523 | } |
| 524 | } |
| 525 | |
| 526 | static int pthread_rwlock_timedwrlock(pthread_rwlock_t *l, const struct timespec *ts) |
| 527 | { |
nothing calls this directly
no test coverage detected