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
d301cc8e
Commit
d301cc8e
authored
Oct 02, 2021
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge 10.5 into 10.6
parents
ec619a1d
98a7fa0c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
4 deletions
+17
-4
storage/innobase/include/rw_lock.h
storage/innobase/include/rw_lock.h
+14
-1
storage/innobase/sync/srw_lock.cc
storage/innobase/sync/srw_lock.cc
+3
-3
No files found.
storage/innobase/include/rw_lock.h
View file @
d301cc8e
...
...
@@ -50,9 +50,22 @@ class rw_lock
static
constexpr
uint32_t
UPDATER
=
1U
<<
29
;
#endif
/* SUX_LOCK_GENERIC */
/** Start waiting for an exclusive lock. */
void
write_lock_wait_start
()
{
#if defined __GNUC__ && (defined __i386__ || defined __x86_64__)
static_assert
(
WRITER_WAITING
==
1U
<<
30
,
"compatibility"
);
__asm__
__volatile__
(
"lock btsl $30, %0"
:
"+m"
(
lock
));
#elif defined _MSC_VER && (defined _M_IX86 || defined _M_IX64)
static_assert
(
WRITER_WAITING
==
1U
<<
30
,
"compatibility"
);
_interlockedbittestandset
(
reinterpret_cast
<
volatile
long
*>
(
&
lock
),
30
);
#else
lock
.
fetch_or
(
WRITER_WAITING
,
std
::
memory_order_relaxed
);
#endif
}
/** Start waiting for an exclusive lock.
@return current value of the lock word */
uint32_t
write_lock_wait_start
()
uint32_t
write_lock_wait_start
_read
()
{
return
lock
.
fetch_or
(
WRITER_WAITING
,
std
::
memory_order_relaxed
);
}
/** Wait for an exclusive lock.
@param l the value of the lock word
...
...
storage/innobase/sync/srw_lock.cc
View file @
d301cc8e
...
...
@@ -193,10 +193,10 @@ void ssux_lock_impl<spinloop>::write_lock(bool holding_u)
{
for
(;;)
{
uint32_t
l
=
write_lock_wait_start
();
write_lock_wait_start
();
const
uint32_t
e
=
holding_u
?
WRITER_WAITING
|
UPDATER
:
WRITER_WAITING
;
l
=
e
;
uint32_t
l
=
e
;
if
(
write_lock_wait_try
(
l
))
return
;
...
...
@@ -213,7 +213,7 @@ void ssux_lock_impl<spinloop>::write_lock(bool holding_u)
return
;
}
for
(
l
=
write_lock_wait_start
()
|
WRITER_WAITING
;
for
(
l
=
write_lock_wait_start
_read
()
|
WRITER_WAITING
;
(
l
|
WRITER_WAITING
)
==
e
;
)
if
(
write_lock_wait_try
(
l
))
return
;
...
...
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