![]()  | 
  
    MySQL 9.5.0
    
   Source Code Documentation 
   | 
 
A "Hazard Pointer" class used to iterate over page lists inside the buffer pool. More...
#include <buf0buf.h>
Public Member Functions | |
| HazardPointer (const buf_pool_t *buf_pool, const ib_mutex_t *mutex) | |
| Constructor.  More... | |
| virtual | ~HazardPointer ()=default | 
| Destructor.  More... | |
| buf_page_t * | get () const | 
| Get current value.  More... | |
| void | set (buf_page_t *bpage) | 
| Set current value.  More... | |
| bool | is_hp (const buf_page_t *bpage) | 
| Checks if a bpage is the hp.  More... | |
| virtual void | adjust (const buf_page_t *bpage)=0 | 
| Adjust the value of hp.  More... | |
| void | move (const buf_page_t *bpage, buf_page_t *dpage) | 
| Adjust the value of hp for moving.  More... | |
Protected Member Functions | |
| HazardPointer (const HazardPointer &) | |
| Disable copying.  More... | |
| HazardPointer & | operator= (const HazardPointer &) | 
Protected Attributes | |
| const buf_pool_t * | m_buf_pool | 
| Buffer pool instance.  More... | |
| const ib_mutex_t * | m_mutex | 
| mutex that protects access to the m_hp.  More... | |
| buf_page_t * | m_hp | 
| hazard pointer.  More... | |
A "Hazard Pointer" class used to iterate over page lists inside the buffer pool.
A hazard pointer is a buf_page_t pointer which we intend to iterate over next and we want it remain valid even after we release the buffer pool mutex.
      
  | 
  inline | 
Constructor.
| buf_pool | buffer pool instance | 
| mutex | mutex that is protecting the hp. | 
      
  | 
  virtualdefault | 
Destructor.
      
  | 
  protected | 
Disable copying.
      
  | 
  pure virtual | 
      
  | 
  inline | 
Get current value.
| bool HazardPointer::is_hp | ( | const buf_page_t * | bpage | ) | 
Checks if a bpage is the hp.
| bpage | buffer block to be compared | 
| void HazardPointer::move | ( | const buf_page_t * | bpage, | 
| buf_page_t * | dpage | ||
| ) | 
Adjust the value of hp for moving.
This happens when some other thread working on the same list attempts to relocate the hp of the page.
| bpage | buffer block to be compared | 
| dpage | buffer block to be moved to | 
      
  | 
  protected | 
| void HazardPointer::set | ( | buf_page_t * | bpage | ) | 
Set current value.
| bpage | buffer block to be set as hp | 
      
  | 
  protected | 
Buffer pool instance.
      
  | 
  protected | 
hazard pointer.
      
  | 
  protected | 
mutex that protects access to the m_hp.