MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / change_victim

Function change_victim

mysys/waiting_threads.c:671–683  ·  view source on GitHub ↗

helper function to change the victim, according to the weight */

Source from the content-addressed store, hash-verified

669 helper function to change the victim, according to the weight
670*/
671static void change_victim(WT_THD* found, struct deadlock_arg *arg)
672{
673 if (found->weight < arg->victim->weight)
674 {
675 if (arg->victim != arg->thd)
676 {
677 rc_unlock(arg->victim->waiting_for); /* release the previous victim */
678 DBUG_ASSERT(arg->last_locked_rc == found->waiting_for);
679 }
680 arg->victim= found;
681 arg->last_locked_rc= 0;
682 }
683}
684
685/**
686 recursive loop detection in a wait-for graph with a limited search depth

Callers 2

deadlock_searchFunction · 0.85
deadlockFunction · 0.85

Calls 1

rc_unlockFunction · 0.85

Tested by

no test coverage detected