OK, so the problem is the code re-inventing the `os_(inc|dec)_counter' calls, that is writing:
if (foreign->referenced_table) { mutex_enter(&(dict_sys->mutex));
(foreign->referenced_table ->n_foreign_key_checks_running)++;
mutex_exit(&(dict_sys->mutex)); }
instead of:
if (foreign->referenced_table) { os_inc_counter(dict_sys->mutex, foreign->referenced_table ->n_foreign_key_checks_running); }
The difference is the latter providing an atomic update while first is not.
Furthermore, `os_inc_counter' is implemented as an atomic in our version (HAVE_ATOMIC_BUILTINS is defined) and is not using `mutex'es at all.
The proposed fix is to use `os_inc_counter'/`os_dec_counter' pair instead.
OK, so the problem is the code re-inventing the `os_(inc| dec)_counter' calls, that is writing:
instead of:
The difference is the latter providing an atomic update while first is not.
Furthermore, `os_inc_counter' is implemented as an atomic in our version (HAVE_ATOMIC_ BUILTINS is defined) and is not using `mutex'es at all.
The proposed fix is to use `os_inc_ counter' /`os_dec_ counter' pair instead.