| 679 | } |
| 680 | |
| 681 | RecErrT |
| 682 | RecGetRecordSource(const char *name, RecSourceT *source, bool lock) |
| 683 | { |
| 684 | RecErrT err = REC_ERR_FAIL; |
| 685 | |
| 686 | if (lock) { |
| 687 | ink_rwlock_rdlock(&g_records_rwlock); |
| 688 | } |
| 689 | |
| 690 | if (auto it = g_records_ht.find(name); it != g_records_ht.end()) { |
| 691 | RecRecord *r = it->second; |
| 692 | |
| 693 | rec_mutex_acquire(&(r->lock)); |
| 694 | *source = r->config_meta.source; |
| 695 | err = REC_ERR_OKAY; |
| 696 | rec_mutex_release(&(r->lock)); |
| 697 | } |
| 698 | |
| 699 | if (lock) { |
| 700 | ink_rwlock_unlock(&g_records_rwlock); |
| 701 | } |
| 702 | |
| 703 | return err; |
| 704 | } |
| 705 | |
| 706 | //------------------------------------------------------------------------- |
| 707 | // RecRegisterStat |
no test coverage detected