Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
2e5d3596
Commit
2e5d3596
authored
Oct 13, 2018
by
Sergey Vojtovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-17441 - InnoDB transition to C++11 atomics
dict_table_t::n_ref_count transition to Atomic_counter.
parent
5c657e9f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
10 deletions
+5
-10
storage/innobase/dict/dict0dict.cc
storage/innobase/dict/dict0dict.cc
+1
-1
storage/innobase/include/dict0dict.ic
storage/innobase/include/dict0dict.ic
+2
-3
storage/innobase/include/dict0mem.h
storage/innobase/include/dict0mem.h
+2
-6
No files found.
storage/innobase/dict/dict0dict.cc
View file @
2e5d3596
...
@@ -437,7 +437,7 @@ dict_table_try_drop_aborted(
...
@@ -437,7 +437,7 @@ dict_table_try_drop_aborted(
dict_table_t
*
table
,
/*!< in: table, or NULL if it
dict_table_t
*
table
,
/*!< in: table, or NULL if it
needs to be looked up again */
needs to be looked up again */
table_id_t
table_id
,
/*!< in: table identifier */
table_id_t
table_id
,
/*!< in: table identifier */
int32
ref_count
)
/*!< in: expected table->n_ref_count */
uint32_t
ref_count
)
/*!< in: expected table->n_ref_count */
{
{
trx_t
*
trx
;
trx_t
*
trx
;
...
...
storage/innobase/include/dict0dict.ic
View file @
2e5d3596
...
@@ -1281,7 +1281,7 @@ void
...
@@ -1281,7 +1281,7 @@ void
dict_table_t::acquire()
dict_table_t::acquire()
{
{
ut_ad(mutex_own(&dict_sys->mutex));
ut_ad(mutex_own(&dict_sys->mutex));
my_atomic_add32_explicit(&n_ref_count, 1, MY_MEMORY_ORDER_RELAXED)
;
n_ref_count++
;
}
}
/** Release the table handle.
/** Release the table handle.
...
@@ -1290,8 +1290,7 @@ inline
...
@@ -1290,8 +1290,7 @@ inline
bool
bool
dict_table_t::release()
dict_table_t::release()
{
{
int32 n = my_atomic_add32_explicit(
auto n = n_ref_count--;
&n_ref_count, -1, MY_MEMORY_ORDER_RELAXED);
ut_ad(n > 0);
ut_ad(n > 0);
return n == 1;
return n == 1;
}
}
...
...
storage/innobase/include/dict0mem.h
View file @
2e5d3596
...
@@ -1615,11 +1615,7 @@ struct dict_table_t {
...
@@ -1615,11 +1615,7 @@ struct dict_table_t {
/** Get reference count.
/** Get reference count.
@return current value of n_ref_count */
@return current value of n_ref_count */
inline
int32
get_ref_count
()
inline
uint32_t
get_ref_count
()
const
{
return
n_ref_count
;
}
{
return
my_atomic_load32_explicit
(
&
n_ref_count
,
MY_MEMORY_ORDER_RELAXED
);
}
/** Acquire the table handle. */
/** Acquire the table handle. */
inline
void
acquire
();
inline
void
acquire
();
...
@@ -2139,7 +2135,7 @@ struct dict_table_t {
...
@@ -2139,7 +2135,7 @@ struct dict_table_t {
/** Count of how many handles are opened to this table. Dropping of the
/** Count of how many handles are opened to this table. Dropping of the
table is NOT allowed until this count gets to zero. MySQL does NOT
table is NOT allowed until this count gets to zero. MySQL does NOT
itself check the number of open handles at DROP. */
itself check the number of open handles at DROP. */
int32
n_ref_count
;
Atomic_counter
<
uint32_t
>
n_ref_count
;
public:
public:
/** List of locks on the table. Protected by lock_sys.mutex. */
/** List of locks on the table. Protected by lock_sys.mutex. */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment