MCPcopy Create free account
hub / github.com/MariaDB/server / tdc_purge

Function tdc_purge

sql/table_cache.cc:690–719  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

688
689
690void tdc_purge(bool all)
691{
692 DBUG_ENTER("tdc_purge");
693 while (all || tdc_records() > tdc_size)
694 {
695 TDC_element *element;
696
697 mysql_mutex_lock(&LOCK_unused_shares);
698 if (!(element= unused_shares.pop_front()))
699 {
700 mysql_mutex_unlock(&LOCK_unused_shares);
701 break;
702 }
703
704 /* Concurrent thread may start using share again, reset prev and next. */
705 element->prev= 0;
706 element->next= 0;
707 mysql_mutex_lock(&element->LOCK_table_share);
708 if (element->ref_count)
709 {
710 mysql_mutex_unlock(&element->LOCK_table_share);
711 mysql_mutex_unlock(&LOCK_unused_shares);
712 continue;
713 }
714 mysql_mutex_unlock(&LOCK_unused_shares);
715
716 tdc_delete_share_from_hash(element);
717 }
718 DBUG_VOID_RETURN;
719}
720
721
722/**

Callers 3

tdc_acquire_shareFunction · 0.85
backup_flushFunction · 0.85
purge_tablesFunction · 0.85

Calls 3

tdc_recordsFunction · 0.85
pop_frontMethod · 0.45

Tested by

no test coverage detected