MySQL 9.1.0
Source Code Documentation
service_locking.h File Reference

Implements mysql_locking_service_st. More...

#include <stddef.h>
#include <stdint.h>

Go to the source code of this file.

Classes

struct  mysql_locking_service_st
 This service provides support for taking read/write locks. More...
 

Macros

#define MYSQL_THD   THD *
 

Typedefs

typedef int(* mysql_acquire_locks_t) (MYSQL_THD opaque_thd, const char *lock_namespace, const char **lock_names, size_t lock_num, enum enum_locking_service_lock_type lock_type, uint64_t lock_timeout)
 Acquire locking service locks. More...
 
typedef int(* mysql_release_locks_t) (MYSQL_THD opaque_thd, const char *lock_namespace)
 Release all lock service locks taken by the given connection in the given namespace. More...
 

Enumerations

enum  enum_locking_service_lock_type { LOCKING_SERVICE_READ , LOCKING_SERVICE_WRITE }
 Types of locking service locks. More...
 

Functions

int mysql_acquire_locking_service_locks (MYSQL_THD opaque_thd, const char *lock_namespace, const char **lock_names, size_t lock_num, enum enum_locking_service_lock_type lock_type, uint64_t lock_timeout)
 
int mysql_release_locking_service_locks (MYSQL_THD opaque_thd, const char *lock_namespace)
 

Variables

struct mysql_locking_service_stmysql_locking_service
 

Detailed Description

Implements mysql_locking_service_st.

Macro Definition Documentation

◆ MYSQL_THD

#define MYSQL_THD   THD *

Typedef Documentation

◆ mysql_acquire_locks_t

typedef int(* mysql_acquire_locks_t) (MYSQL_THD opaque_thd, const char *lock_namespace, const char **lock_names, size_t lock_num, enum enum_locking_service_lock_type lock_type, uint64_t lock_timeout)

Acquire locking service locks.

Parameters
opaque_thdThread handle. If NULL, current_thd will be used.
lock_namespaceNamespace of the locks to acquire.
lock_namesArray of names of the locks to acquire.
lock_numNumber of elements in 'lock_names'.
lock_typeLock type to acquire. LOCKING_SERVICE_READ or _WRITE.
lock_timeoutNumber of seconds to wait before giving up.
Return values
1Acquisition failed, error has been reported.
0Acquisition successful, all locks acquired.
Note
both lock_namespace and lock_names are limited to 64 characters max. Names are compared using binary comparison.
See also
acquire_locking_service_locks, MDL_context::acquire_locks

◆ mysql_release_locks_t

typedef int(* mysql_release_locks_t) (MYSQL_THD opaque_thd, const char *lock_namespace)

Release all lock service locks taken by the given connection in the given namespace.

Parameters
opaque_thdThread handle. If NULL, current_thd will be used.
lock_namespaceNamespace of the locks to release.
Return values
1Release failed, error has been reported.
0Release successful, all locks acquired.
See also
release_locking_service_locks, MDL_context::release_locks

Enumeration Type Documentation

◆ enum_locking_service_lock_type

Types of locking service locks.

LOCKING_SERVICE_READ is compatible with LOCKING_SERVICE_READ. All other combinations are incompatible.

Enumerator
LOCKING_SERVICE_READ 
LOCKING_SERVICE_WRITE 

Function Documentation

◆ mysql_acquire_locking_service_locks()

int mysql_acquire_locking_service_locks ( MYSQL_THD  opaque_thd,
const char *  lock_namespace,
const char **  lock_names,
size_t  lock_num,
enum enum_locking_service_lock_type  lock_type,
uint64_t  lock_timeout 
)

◆ mysql_release_locking_service_locks()

int mysql_release_locking_service_locks ( MYSQL_THD  opaque_thd,
const char *  lock_namespace 
)