1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Backport of revno: 2617.68.13

Introduce a counter for protection against global read lock on thread level.

The functions for protection against global read lock sometimes need a local
variable to signal when the protection is set, and hence need to be released.
It would be better to control this behaviour via a counter on the THD struct,
telling how many times the protection has been claimed by the current thread.
A side-effect of the fix is that if protection is claimed twice for a thread,
only a simple increment is required for the second claim, instead of a
mutex-protected increment of the global variable protect_against_global_read_lock.
This commit is contained in:
Jon Olav Hauglid
2009-12-09 15:25:48 +01:00
parent 1642f67b40
commit 17252c3258
6 changed files with 115 additions and 32 deletions

View File

@ -452,6 +452,7 @@ THD::THD()
examined_row_count(0),
warning_info(&main_warning_info),
stmt_da(&main_da),
global_read_lock_protection(0),
global_read_lock(0),
is_fatal_error(0),
transaction_rollback_request(0),