typedef struct lock_struct lock_t; //利用typedef定义一个变量的类型 /** Lock struct */
struct lock_struct {
trx_t* trx; /*!< transaction owning the lock */
UT_LIST_NODE_T(lock_t) trx_locks; /*!< list of the locks of the transaction */
ulint type_mode; //锁的类型 /*!< lock type, mode, LOCK_GAP or
LOCK_REC_NOT_GAP,
LOCK_INSERT_INTENTION,
wait flag, ORed */
hash_node_t hash; /*!< hash chain node for a record lock */ //typedef void* hash_node_t;
dict_index_t* index; /*!< index for a record lock */
union {
lock_table_t tab_lock; /*!< table lock */
lock_rec_t rec_lock; /*!< record lock */
} un_member; /*!< lock details */
};