MINOR: vars: centralize the lock/unlock into static inlines

The goal it to simplify the variables locking in order to later
simplify it.
2 files changed