MCPcopy Create free account
hub / github.com/apache/trafficserver / RecSetSyncRequired

Function RecSetSyncRequired

src/records/P_RecCore.cc:458–487  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

456}
457
458RecErrT
459RecSetSyncRequired(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}

Callers 1

process_config_updateFunction · 0.85

Calls 7

ink_rwlock_wrlockFunction · 0.85
i_am_the_record_ownerFunction · 0.85
rec_mutex_acquireFunction · 0.85
rec_mutex_releaseFunction · 0.85
ink_rwlock_unlockFunction · 0.85
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected