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
e59d080f
Commit
e59d080f
authored
Oct 06, 2017
by
Eugene Kosov
Committed by
Sergey Vojtovich
Oct 06, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix a data race in debug build (#456)
fix a data race in debug build This particular one flooded TSAN report.
parent
a4948daf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
7 deletions
+9
-7
storage/innobase/include/sync0policy.h
storage/innobase/include/sync0policy.h
+6
-6
storage/innobase/include/sync0policy.ic
storage/innobase/include/sync0policy.ic
+1
-1
storage/innobase/include/sync0types.h
storage/innobase/include/sync0types.h
+2
-0
No files found.
storage/innobase/include/sync0policy.h
View file @
e59d080f
...
...
@@ -76,7 +76,7 @@ class MutexDebug {
{
m_mutex
=
mutex
;
m
_thread_id
=
os_thread_get_curr_id
(
);
m
y_atomic_storelint
(
&
m_thread_id
,
os_thread_get_curr_id
()
);
m_filename
=
filename
;
...
...
@@ -89,7 +89,7 @@ class MutexDebug {
{
m_mutex
=
NULL
;
m
_thread_id
=
os_thread_id_t
(
ULINT_UNDEFINED
);
m
y_atomic_storelint
(
&
m_thread_id
,
ULINT_UNDEFINED
);
m_filename
=
NULL
;
...
...
@@ -138,7 +138,7 @@ class MutexDebug {
unsigned
m_line
;
/** Thread ID of the thread that own(ed) the mutex */
os_thread_id_t
m_thread_id
;
ulint
m_thread_id
;
};
/** Constructor. */
...
...
@@ -157,7 +157,7 @@ class MutexDebug {
/** Mutex is being destroyed. */
void
destroy
()
UNIV_NOTHROW
{
ut_ad
(
m_context
.
m_thread_id
==
os_thread_id_t
(
ULINT_UNDEFINED
)
);
ut_ad
(
(
ulint
)
my_atomic_loadlint
(
&
m_context
.
m_thread_id
)
==
ULINT_UNDEFINED
);
m_magic_n
=
0
;
...
...
@@ -199,7 +199,7 @@ class MutexDebug {
bool
is_owned
()
const
UNIV_NOTHROW
{
return
(
os_thread_eq
(
m
_context
.
m_thread_id
,
m
y_atomic_loadlint
(
&
m_context
.
m_thread_id
)
,
os_thread_get_curr_id
()));
}
...
...
@@ -221,7 +221,7 @@ class MutexDebug {
os_thread_id_t
get_thread_id
()
const
UNIV_NOTHROW
{
return
(
m
_context
.
m_thread_id
);
return
(
m
y_atomic_loadlint
(
&
m_context
.
m_thread_id
)
);
}
/** Magic number to check for memory corruption. */
...
...
storage/innobase/include/sync0policy.ic
View file @
e59d080f
...
...
@@ -80,7 +80,7 @@ void MutexDebug<Mutex>::locked(
UNIV_NOTHROW
{
ut_ad(!is_owned());
ut_ad(m_context.m_thread_id ==
os_thread_id_t(ULINT_UNDEFINED)
);
ut_ad(m_context.m_thread_id ==
ULINT_UNDEFINED
);
m_context.locked(mutex, name, line);
...
...
storage/innobase/include/sync0types.h
View file @
e59d080f
...
...
@@ -1163,10 +1163,12 @@ enum rw_lock_flag_t {
#ifdef _WIN64
#define my_atomic_addlint(A,B) my_atomic_add64((int64*) (A), (B))
#define my_atomic_loadlint(A) my_atomic_load64((int64*) (A))
#define my_atomic_storelint(A,B) my_atomic_store64((int64*) (A), (B))
#define my_atomic_caslint(A,B,C) my_atomic_cas64((int64*) (A), (int64*) (B), (C))
#else
#define my_atomic_addlint my_atomic_addlong
#define my_atomic_loadlint my_atomic_loadlong
#define my_atomic_storelint my_atomic_storelong
#define my_atomic_caslint my_atomic_caslong
#endif
...
...
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