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

Function rc_wrlock

mysys/waiting_threads.c:434–443  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

432 DBUG_PRINT("wt", ("LOCK resid=%ld for READ", (ulong)rc->id.value));
433}
434static void rc_wrlock(WT_RESOURCE *rc)
435{
436 DBUG_PRINT("wt", ("TRYLOCK resid=%ld for WRITE", (ulong)rc->id.value));
437 mysql_mutex_lock(&rc->lock.mutex);
438 while (rc->lock.write_locked || rc->lock.readers)
439 mysql_cond_wait(&rc->lock.cond, &rc->lock.mutex);
440 rc->lock.write_locked= 1;
441 mysql_mutex_unlock(&rc->lock.mutex);
442 DBUG_PRINT("wt", ("LOCK resid=%ld for WRITE", (ulong)rc->id.value));
443}
444static void rc_unlock(WT_RESOURCE *rc)
445{
446 DBUG_PRINT("wt", ("UNLOCK resid=%ld", (ulong)rc->id.value));

Callers 4

stop_waitingFunction · 0.85
wt_thd_will_wait_forFunction · 0.85
wt_thd_cond_timedwaitFunction · 0.85
wt_thd_releaseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected