Version Tokens • version_tokens_lock_exclusive()  acquires exclusive version token locks. It takes a list of one or more lock names and a timeout value. • version_tokens_lock_shared()  acquires shared version token locks. It takes a list of one or more lock names and a timeout value. • version_tokens_unlock()  releases version token locks (exclusive and shared). It takes no argument. Each locking function returns nonzero for success. Otherwise, an error occurs: mysql>  SELECT version_tokens_lock_shared(’lock1’, ’lock2’, 0); +-------------------------------------------------+ | version_tokens_lock_shared(’lock1’, ’lock2’, 0) | +-------------------------------------------------+ | 1 | +-------------------------------------------------+ mysql>  SELECT version_tokens_lock_shared(NULL, 0); ERROR 3131 (42000): Incorrect locking service lock name ’(null)’. Locking using Version Tokens locking functions is advisory; applications must agree to cooperate. It is possible to lock nonexisting token names. This does not create the tokens. Note Version Tokens locking functions are based on the locking service described at Section 5.6.9.1, “The Locking Service” , and thus have the same semantics for shared and exclusive locks. (Version Tokens uses the locking service routines built into the server, not the locking service function interface, so those functions need not be installed to use Version Tokens.) Locks acquired by Version Tokens use a locking service namespace of  version_token_locks . Locking service locks can be monitored using the Performance Schema, so this is also true for Version Tokens locks. For details, see Locking Service Monitoring. For the Version Tokens locking functions, token name arguments are used exactly as specified. Surrounding whitespace is not ignored and  =  and  ;  characters are permitted. This is because Version Tokens simply passes the token names to be locked as is to the locking service. The following discussion serves as a reference to these Version Tokens elements: •Version Tokens Functions •Version Tokens System Variables 5.6.6.4 Version Tokens Reference Version Tokens Functions 1105 The Version Tokens plugin library includes several functions. One set of functions permits the server’s list of version tokens to be manipulated and inspected. Another set of functions permits version tokens to be locked and unlocked. The  VERSION_TOKEN_ADMIN  privilege (or the deprecated  SUPER  privilege) is required to invoke any Version Tokens function. The following functions permit the server’s list of version tokens to be created, changed, removed, and inspected. Interpretation of  name_list  and  token_list  arguments (including whitespace handling)