| 456 | } |
| 457 | |
| 458 | RecErrT |
| 459 | RecSetSyncRequired(const char *name, bool lock) |
| 460 | { |
| 461 | RecErrT err = REC_ERR_FAIL; |
| 462 | RecRecord *r1; |
| 463 | |
| 464 | // FIXME: Most of the time we set, we don't actually need to wrlock |
| 465 | // since we are not modifying the g_records_ht. |
| 466 | if (lock) { |
| 467 | ink_rwlock_wrlock(&g_records_rwlock); |
| 468 | } |
| 469 | if (auto it = g_records_ht.find(name); it != g_records_ht.end()) { |
| 470 | r1 = it->second; |
| 471 | if (i_am_the_record_owner(r1->rec_type)) { |
| 472 | rec_mutex_acquire(&(r1->lock)); |
| 473 | r1->sync_required = REC_PEER_SYNC_REQUIRED; |
| 474 | if (REC_TYPE_IS_CONFIG(r1->rec_type)) { |
| 475 | r1->config_meta.update_required = REC_UPDATE_REQUIRED; |
| 476 | } |
| 477 | rec_mutex_release(&(r1->lock)); |
| 478 | err = REC_ERR_OKAY; |
| 479 | } |
| 480 | } |
| 481 | |
| 482 | if (lock) { |
| 483 | ink_rwlock_unlock(&g_records_rwlock); |
| 484 | } |
| 485 | |
| 486 | return err; |
| 487 | } |
no test coverage detected