MySQL 9.1.0
Source Code Documentation
locking_service.h File Reference
#include <stddef.h>
#include "my_systime.h"
#include "mysql/service_locking.h"

Go to the source code of this file.

Functions

int 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, Timeout_type lock_timeout)
 Acquire locking service locks. More...
 
int release_locking_service_locks (MYSQL_THD opaque_thd, const char *lock_namespace)
 Release all lock service locks taken by the given connection in the given namespace. More...
 
void release_all_locking_service_locks (THD *thd)
 Release all locking service locks taken by the given connection in all namespaces. More...
 

Function Documentation

◆ acquire_locking_service_locks()

int 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,
Timeout_type  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.

◆ release_all_locking_service_locks()

void release_all_locking_service_locks ( THD thd)

Release all locking service locks taken by the given connection in all namespaces.

Parameters
thdThread handle.

◆ release_locking_service_locks()

int release_locking_service_locks ( 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.