- 论坛徽章:
- 0
|
看代码看到有如下
- 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 */
- 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 */
- };
- typedef struct lock_struct lock_t;
- lock_rec_get_nth_bit(const lock_t* lock,ulint i)
- {
- return(1 & ((const byte*) &lock[1])[byte_index] >> bit_index);
- }
复制代码 这一行代码看不明白了,取的到底是结构体里的哪部分值?
- return(1 & ((const byte*) &lock[1])[byte_index] >> bit_index);
复制代码 |
|