diff options
Diffstat (limited to 'storage/innobase/include/trx0trx.h')
-rw-r--r-- | storage/innobase/include/trx0trx.h | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h index bf9a2acd622..505ef96e01d 100644 --- a/storage/innobase/include/trx0trx.h +++ b/storage/innobase/include/trx0trx.h @@ -339,27 +339,11 @@ struct trx_lock_t /** lock wait start time */ Atomic_relaxed<my_hrtime_t> suspend_time; +#if defined(UNIV_DEBUG) || !defined(DBUG_OFF) /** 2=high priority WSREP thread has marked this trx to abort; 1=another transaction chose this as a victim in deadlock resolution. */ Atomic_relaxed<byte> was_chosen_as_deadlock_victim; - /** Clear the deadlock victim status. */ - void clear_deadlock_victim() - { -#ifndef WITH_WSREP - was_chosen_as_deadlock_victim= false; -#elif defined __GNUC__ && (defined __i386__ || defined __x86_64__) - /* There is no 8-bit version of the 80386 BTR instruction. - Technically, this is the wrong addressing mode (16-bit), but - there are other data members stored after the byte. */ - __asm__ __volatile__("lock btrw $0, %0" - : "+m" (was_chosen_as_deadlock_victim)); -#else - was_chosen_as_deadlock_victim.fetch_and(byte(~1)); -#endif - } - -#ifdef WITH_WSREP /** Flag the lock owner as a victim in Galera conflict resolution. */ void set_wsrep_victim() { @@ -373,7 +357,17 @@ struct trx_lock_t was_chosen_as_deadlock_victim.fetch_or(2); # endif } -#endif +#else /* defined(UNIV_DEBUG) || !defined(DBUG_OFF) */ + + /** High priority WSREP thread has marked this trx to abort or + another transaction chose this as a victim in deadlock resolution. */ + Atomic_relaxed<bool> was_chosen_as_deadlock_victim; + + /** Flag the lock owner as a victim in Galera conflict resolution. */ + void set_wsrep_victim() { + was_chosen_as_deadlock_victim= true; + } +#endif /* defined(UNIV_DEBUG) || !defined(DBUG_OFF) */ /** Next available rec_pool[] entry */ byte rec_cached; |