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

Function stop_waiting_locked

mysys/waiting_threads.c:961–973  ·  view source on GitHub ↗

register the fact that thd is not waiting anymore decrease waiter_count, clear waiting_for, free the resource if appropriate. thd->waiting_for must be locked! */

Source from the content-addressed store, hash-verified

959 thd->waiting_for must be locked!
960*/
961static int stop_waiting_locked(WT_THD *thd)
962{
963 int ret;
964 WT_RESOURCE *rc= thd->waiting_for;
965 DBUG_ENTER("stop_waiting_locked");
966
967 DBUG_ASSERT(rc->waiter_count);
968 DBUG_ASSERT(rc->state == ACTIVE);
969 rc->waiter_count--;
970 thd->waiting_for= 0;
971 ret= unlock_lock_and_free_resource(thd, rc);
972 DBUG_RETURN((thd->killed || ret) ? WT_DEADLOCK : WT_OK);
973}
974
975/**
976 register the fact that thd is not waiting anymore

Callers 2

stop_waitingFunction · 0.85
wt_thd_will_wait_forFunction · 0.85

Calls 1

Tested by

no test coverage detected