Skip to content

Commit dd0ffae

Browse files
committed
Need to fix rw lock codes
1 parent 89e1b84 commit dd0ffae

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

storage/innobase/buf/buf0buf.cc

+5-3
Original file line numberDiff line numberDiff line change
@@ -1854,15 +1854,17 @@ buf_pool_init_instance(
18541854
UNIV_PAGE_SIZE));
18551855

18561856
/* Initialize hash structure for copy pool. */
1857-
srv_n_twb_hash_locks = static_cast<ulong>(
1858-
ut_2_power_up(srv_n_twb_hash_locks));
1859-
18601857
buf_pool->twb_hash = ib_create(
18611858
2 * buf_pool->total_entry,
18621859
LATCH_ID_HASH_TABLE_RW_LOCK,
18631860
srv_n_twb_hash_locks,
18641861
MEM_HEAP_FOR_TWB_HASH);
18651862

1863+
buf_pool->twb_hash_lock = static_cast<rw_lock_t*>(
1864+
ut_malloc_nokey(sizeof(rw_lock_t)));
1865+
rw_lock_create(PFS_NOT_INSTRUMENTED, &buf_pool->twb_hash_lock,
1866+
SYNC_LEVEL_VARYING);
1867+
18661868
/* Initialize a block and page structure. */
18671869
buf_pool->twb_block_arr = static_cast<buf_block_t*>(
18681870
ut_zalloc_nokey(buf_pool->total_entry * sizeof(buf_block_t)));

storage/innobase/ha/ha0ha.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ ib_create(
6060

6161
ut_a(type == MEM_HEAP_FOR_BTR_SEARCH
6262
|| type == MEM_HEAP_FOR_PAGE_HASH
63-
/* mijin */
63+
/* mijin */
6464
|| type == MEM_HEAP_FOR_TWB_HASH
6565
/* end */);
6666

storage/innobase/include/buf0buf.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -2294,7 +2294,7 @@ struct buf_pool_t{
22942294
/*!< the number of blocks in TWB */
22952295
hash_table_t* twb_hash; /*!< hash table of twb_meta_dir_t,
22962296
indexed by (space_id, offset) */
2297-
//rw_lock_t* twb_hash_lock;
2297+
rw_lock_t* twb_hash_lock;
22982298
buf_block_t* twb_block_arr; /*!< array to store pointers
22992299
to the buffer blocks which have been cached
23002300
to write_buf */

0 commit comments

Comments
 (0)