Commit 311ea6a8 authored by marko's avatar marko

branches/zip: Make buf_block_t:old a bit-field. Document the mutex protection

of the fields "freed_page_clock" and "old".
parent da966628
...@@ -611,6 +611,9 @@ buf_LRU_old_init(void) ...@@ -611,6 +611,9 @@ buf_LRU_old_init(void)
{ {
buf_block_t* block; buf_block_t* block;
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(buf_pool->mutex)));
#endif /* UNIV_SYNC_DEBUG */
ut_a(UT_LIST_GET_LEN(buf_pool->LRU) == BUF_LRU_OLD_MIN_LEN); ut_a(UT_LIST_GET_LEN(buf_pool->LRU) == BUF_LRU_OLD_MIN_LEN);
/* We first initialize all blocks in the LRU list as old and then use /* We first initialize all blocks in the LRU list as old and then use
......
...@@ -809,11 +809,13 @@ struct buf_block_struct{ ...@@ -809,11 +809,13 @@ struct buf_block_struct{
ulint freed_page_clock;/* the value of freed_page_clock ulint freed_page_clock;/* the value of freed_page_clock
of the buffer pool when this block was of the buffer pool when this block was
the last time put to the head of the the last time put to the head of the
LRU list; a thread is allowed to LRU list; protected by buf_pool->mutex;
read this for heuristic purposes a thread is allowed to read this for
without holding any mutex or latch */ heuristic purposes without holding any
ibool old; /* TRUE if the block is in the old mutex or latch */
blocks in the LRU list */ ulint old:1; /* TRUE if the block is in the old
blocks in the LRU list; protected
by buf_pool->mutex */
ulint accessed:1; /* TRUE if the page has been accessed ulint accessed:1; /* TRUE if the page has been accessed
while in the buffer pool: read-ahead while in the buffer pool: read-ahead
may read in pages which have not been may read in pages which have not been
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment