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
dab38ce0
Commit
dab38ce0
authored
Oct 14, 2018
by
Sergey Vojtovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-17441 - InnoDB transition to C++11 atomics
Replaced simple_atomic_counter with Atomic_counter.
parent
e976c7db
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
27 deletions
+4
-27
storage/innobase/include/srv0srv.h
storage/innobase/include/srv0srv.h
+2
-1
storage/innobase/include/sync0types.h
storage/innobase/include/sync0types.h
+0
-24
storage/innobase/lock/lock0wait.cc
storage/innobase/lock/lock0wait.cc
+2
-2
No files found.
storage/innobase/include/srv0srv.h
View file @
dab38ce0
...
...
@@ -143,7 +143,8 @@ struct srv_stats_t
ulint_ctr_1_t
n_lock_wait_count
;
/** Number of threads currently waiting on database locks */
simple_atomic_counter
<>
n_lock_wait_current_count
;
MY_ALIGNED
(
CACHE_LINE_SIZE
)
Atomic_counter
<
ulint
>
n_lock_wait_current_count
;
/** Number of rows read. */
ulint_ctr_64_t
n_rows_read
;
...
...
storage/innobase/include/sync0types.h
View file @
dab38ce0
...
...
@@ -1184,28 +1184,4 @@ struct MY_ALIGNED(CPU_LEVEL1_DCACHE_LINESIZE) simple_counter
/** The counter */
Type
m_counter
;
}
;
/** Simple atomic counter aligned to CACHE_LINE_SIZE
@tparam Type lint or ulint */
template
<
typename
Type
=
ulint
>
struct
MY_ALIGNED
(
CPU_LEVEL1_DCACHE_LINESIZE
)
simple_atomic_counter
{
/** Increment the counter */
Type
inc
()
{
return
add
(
1
);
}
/** Decrement the counter */
Type
dec
()
{
return
add
(
Type
(
~
0
));
}
/** Add to the counter
@param[in] i amount to be added
@return the value of the counter before adding */
Type
add
(
Type
i
)
{
return
my_atomic_addlint
(
&
m_counter
,
i
);
}
/** @return the value of the counter (non-atomic access)! */
operator
Type
()
const
{
return
m_counter
;
}
private
:
/** The counter */
Type
m_counter
;
}
;
#endif
/* sync0types_h */
storage/innobase/lock/lock0wait.cc
View file @
dab38ce0
...
...
@@ -285,7 +285,7 @@ lock_wait_suspend_thread(
if
(
thr
->
lock_state
==
QUE_THR_LOCK_ROW
)
{
srv_stats
.
n_lock_wait_count
.
inc
();
srv_stats
.
n_lock_wait_current_count
.
inc
()
;
srv_stats
.
n_lock_wait_current_count
++
;
if
(
ut_usectime
(
&
sec
,
&
ms
)
==
-
1
)
{
start_time
=
-
1
;
...
...
@@ -398,7 +398,7 @@ lock_wait_suspend_thread(
thd_storage_lock_wait
(
trx
->
mysql_thd
,
diff_time
);
}
srv_stats
.
n_lock_wait_current_count
.
dec
()
;
srv_stats
.
n_lock_wait_current_count
--
;
DBUG_EXECUTE_IF
(
"lock_instrument_slow_query_log"
,
os_thread_sleep
(
1000
););
...
...
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