MCPcopy Create free account
hub / github.com/Hamlib/Hamlib / pthread_rwlock_timedwrlock

Function pthread_rwlock_timedwrlock

include/hamlib/winpthreads.h:526–545  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

524}
525
526static 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
547static int pthread_get_concurrency(int *val)
548{

Callers

nothing calls this directly

Calls 4

_pthread_time_in_msFunction · 0.85
pthread_testcancelFunction · 0.85
pthread_rwlock_trywrlockFunction · 0.85

Tested by

no test coverage detected