MCPcopy Create free account
hub / github.com/Tencent/phxsql / dec_prep_xids

Method dec_prep_xids

phx_percona/percona/sql/binlog.h:337–352  ·  view source on GitHub ↗

Decrement the prepared XID counter. Signal m_prep_xids_cond if the counter reaches zero. */

Source from the content-addressed store, hash-verified

335 Signal m_prep_xids_cond if the counter reaches zero.
336 */
337 void dec_prep_xids(THD *thd) {
338 DBUG_ENTER("MYSQL_BIN_LOG::dec_prep_xids");
339 my_atomic_rwlock_wrlock(&m_prep_xids_lock);
340 int32 result= my_atomic_add32(&m_prep_xids, -1);
341 DBUG_PRINT("debug", ("m_prep_xids: %d", result - 1));
342 my_atomic_rwlock_wrunlock(&m_prep_xids_lock);
343 thd->transaction.flags.xid_written= false;
344 /* If the old value was 1, it is zero now. */
345 if (result == 1)
346 {
347 mysql_mutex_lock(&LOCK_xids);
348 mysql_cond_signal(&m_prep_xids_cond);
349 mysql_mutex_unlock(&LOCK_xids);
350 }
351 DBUG_VOID_RETURN;
352 }
353
354 int32 get_prep_xids() {
355 my_atomic_rwlock_rdlock(&m_prep_xids_lock);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected