MySQL 8.4.2
Source Code Documentation
User_level_lock Struct Reference

For locks with EXPLICIT duration, MDL returns a new ticket every time a lock is granted. More...

Public Attributes

MDL_ticketticket
 
uint refs
 

Detailed Description

For locks with EXPLICIT duration, MDL returns a new ticket every time a lock is granted.

This allows to implement recursive locks without extra allocation or additional data structures, such as below. However, if there are too many tickets in the same MDL_context, MDL_context::find_ticket() is getting too slow, since it's using a linear search. This is why a separate structure is allocated for a user level lock held by connection, and before requesting a new lock from MDL, GET_LOCK() checks thd->ull_hash if such lock is already granted, and if so, simply increments a reference counter.

Member Data Documentation

◆ refs

uint User_level_lock::refs

◆ ticket

MDL_ticket* User_level_lock::ticket

The documentation for this struct was generated from the following file: