MySQL Plugin Services • lock_namespace : A null-terminated string that indicates the lock namespace. • lock_names : An array of null-terminated strings that provides the names of the locks to acquire. • lock_num : The number of names in the  lock_names  array. • lock_type : The lock mode, either  LOCKING_SERVICE_READ  or  LOCKING_SERVICE_WRITE  to acquire read locks or write locks, respectively. • lock_timeout : An integer number of seconds to wait to acquire the locks before giving up. To release locks acquired for a given namespace, call this function: int mysql_release_locking_service_locks(MYSQL_THD opaque_thd, const char* lock_namespace); • opaque_thd : A thread handle. If specified as  NULL , the handle for the current thread is used. • lock_namespace : A null-terminated string that indicates the lock namespace. The arguments have these meanings: Locks acquired or waited for by the locking service can be monitored at the SQL level using the Performance Schema. For details, see Locking Service Monitoring. This section describes how to use the locking service interface provided by its loadable functions. To use the C language interface instead, see The Locking Service C Interface For general characteristics of the locking service interface, see Section 5.6.9.1, “The Locking Service” . For general information about loadable functions, see Adding a Loadable Function. The Locking Service Function Interface •Installing or Uninstalling the Locking Service Function Interface •Using the Locking Service Function Interface •Locking Service Monitoring •Locking Service Interface Function Reference Installing or Uninstalling the Locking Service Function Interface The locking service routines described in The Locking Service C Interface need not be installed because they are built into the server. The same is not true of the loadable functions that map onto calls to the service routines: The functions must be installed before use. This section describes how to do that. For general information about loadable function installation, see Section 5.7.1, “Installing and Uninstalling Loadable Functions” . The locking service functions are implemented in a plugin library file located in the directory named by the plugin_dir  system variable. The file base name is  locking_service . The file name suffix differs per platform (for example,  .so  for Unix and Unix-like systems,  .dll  for Windows). To install the locking service functions, use the  CREATE FUNCTION  statement, adjusting the  .so  suffix for your platform as necessary: CREATE FUNCTION service_get_read_locks RETURNS INT SONAME ’locking_service.so’; CREATE FUNCTION service_get_write_locks RETURNS INT 1137