mirror of
https://github.com/MariaDB/server.git
synced 2025-08-16 18:19:41 +00:00
MDEV-17441 - InnoDB transition to C++11 atomics
Added lf_hash_size() macro, so that callers don't need to use atomic operations.
This commit is contained in:
@ -167,6 +167,8 @@ void *lf_hash_search_using_hash_value(LF_HASH *hash, LF_PINS *pins,
|
||||
int lf_hash_delete(LF_HASH *hash, LF_PINS *pins, const void *key, uint keylen);
|
||||
int lf_hash_iterate(LF_HASH *hash, LF_PINS *pins,
|
||||
my_hash_walk_action action, void *argument);
|
||||
#define lf_hash_size(hash) \
|
||||
my_atomic_load32_explicit(&(hash)->count, MY_MEMORY_ORDER_RELAXED)
|
||||
/*
|
||||
shortcut macros to access underlying pinbox functions from an LF_HASH
|
||||
see lf_pinbox_get_pins() and lf_pinbox_put_pins()
|
||||
|
@ -782,7 +782,7 @@ void MDL_map::destroy()
|
||||
{
|
||||
delete m_backup_lock;
|
||||
|
||||
DBUG_ASSERT(!my_atomic_load32(&m_locks.count));
|
||||
DBUG_ASSERT(!lf_hash_size(&m_locks));
|
||||
lf_hash_destroy(&m_locks);
|
||||
}
|
||||
|
||||
|
@ -689,7 +689,7 @@ void tdc_deinit(void)
|
||||
|
||||
ulong tdc_records(void)
|
||||
{
|
||||
return my_atomic_load32_explicit(&tdc_hash.count, MY_MEMORY_ORDER_RELAXED);
|
||||
return lf_hash_size(&tdc_hash);
|
||||
}
|
||||
|
||||
|
||||
|
@ -704,11 +704,7 @@ public:
|
||||
because it may change even before this method returns.
|
||||
*/
|
||||
|
||||
uint32_t size()
|
||||
{
|
||||
return uint32_t(my_atomic_load32_explicit(&hash.count,
|
||||
MY_MEMORY_ORDER_RELAXED));
|
||||
}
|
||||
uint32_t size() { return uint32_t(lf_hash_size(&hash)); }
|
||||
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user