From 305c1ae157de414bbd3e4a89cddbe522eaa1a309 Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Tue, 12 Aug 2014 16:39:10 -0400 Subject: Merge of innobase changes to xtradb. (r3871..3873). --- storage/xtradb/row/row0upd.cc | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) (limited to 'storage/xtradb/row/row0upd.cc') diff --git a/storage/xtradb/row/row0upd.cc b/storage/xtradb/row/row0upd.cc index 4b8dff7b47f..bdd2a691368 100644 --- a/storage/xtradb/row/row0upd.cc +++ b/storage/xtradb/row/row0upd.cc @@ -419,12 +419,9 @@ wsrep_row_upd_check_foreign_constraints( } if (foreign->referenced_table) { - mutex_enter(&(dict_sys->mutex)); - - (foreign->referenced_table - ->n_foreign_key_checks_running)++; - - mutex_exit(&(dict_sys->mutex)); + os_inc_counter(dict_sys->mutex, + foreign->referenced_table + ->n_foreign_key_checks_running); } /* NOTE that if the thread ends up waiting for a lock @@ -436,20 +433,14 @@ wsrep_row_upd_check_foreign_constraints( TRUE, foreign, table, entry, thr); if (foreign->referenced_table) { - mutex_enter(&(dict_sys->mutex)); - - ut_a(foreign->referenced_table - ->n_foreign_key_checks_running > 0); - - (foreign->referenced_table - ->n_foreign_key_checks_running)--; + os_dec_counter(dict_sys->mutex, + foreign->referenced_table + ->n_foreign_key_checks_running); if (opened == TRUE) { dict_table_close(foreign->referenced_table, TRUE, FALSE); opened = FALSE; } - - mutex_exit(&(dict_sys->mutex)); } if (err != DB_SUCCESS) { -- cgit v1.2.1