You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
storage/innobase/dict/dict0dict: add a RAII class to freeze a dict_sys_t
This replaces a lot of manual freeze() and unfreeze() call. Doing it
with RAII is safer and easier.
I did not replace all freeze()/unfreeze() pairs because some callers
unfreeze and re-freeze in the middle of a scope. Sometimes, adding a
new scope can be added just for such a RAII object. Refactoring that
can be done later.
Notes:
- Instead of using the global variable `dict_sys`, I decided to pass a
`dict_sys_t` reference parameter, because I believe it will be
necessary to eliminate that global variable eventually (in order to
have a per-catalog instance). Hard-coding this global variable here
would generate identical (not better) machine code and would be a
step in the wrong direction.
- The new macros `SRW_LOCK_ARGS2` and `SRW_LOCK_CALL2` were necessary
because this is the first time those debug-only parameters are
forwarded from a function that has more parameters (i.e. the
dict_sys_t reference).
0 commit comments