| 524 | } |
| 525 | |
| 526 | static int pthread_rwlock_timedwrlock(pthread_rwlock_t *l, const struct timespec *ts) |
| 527 | { |
| 528 | unsigned long long ct = _pthread_time_in_ms(); |
| 529 | unsigned long long t = _pthread_time_in_ms_from_timespec(ts); |
| 530 | |
| 531 | pthread_testcancel(); |
| 532 | |
| 533 | /* Use a busy-loop */ |
| 534 | while (1) |
| 535 | { |
| 536 | /* Try to grab lock */ |
| 537 | if (!pthread_rwlock_trywrlock(l)) return 0; |
| 538 | |
| 539 | /* Get current time */ |
| 540 | ct = _pthread_time_in_ms(); |
| 541 | |
| 542 | /* Have we waited long enough? */ |
| 543 | if (ct > t) return ETIMEDOUT; |
| 544 | } |
| 545 | } |
| 546 | |
| 547 | static int pthread_get_concurrency(int *val) |
| 548 | { |
nothing calls this directly
no test coverage detected