结构体 lock_t;

 

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 */
};

 

posted @ 2015-11-04 15:51  taek  阅读(654)  评论(0编辑  收藏  举报