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
e79fa9f5
Commit
e79fa9f5
authored
Sep 28, 2021
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-26467: Actually use spinloop on block_lock
In commit
277ba134
we accidentally omitted this.
parent
d0d4ade9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
storage/innobase/include/srw_lock.h
storage/innobase/include/srw_lock.h
+1
-1
storage/innobase/sync/srw_lock.cc
storage/innobase/sync/srw_lock.cc
+16
-0
No files found.
storage/innobase/include/srw_lock.h
View file @
e79fa9f5
...
...
@@ -151,7 +151,7 @@ class ssux_lock_impl final
void
wr_unlock
();
#else
/** mutex for synchronization; held by U or X lock holders */
srw_mutex
writer
;
srw_mutex
_impl
<
spinloop
>
writer
;
/** S or U holders, and WRITER flag for X holder or waiter */
std
::
atomic
<
uint32_t
>
readers
;
/** indicates an X request; readers=WRITER indicates granted X lock */
...
...
storage/innobase/sync/srw_lock.cc
View file @
e79fa9f5
...
...
@@ -417,7 +417,23 @@ void ssux_lock_impl<spinloop>::wr_wait(uint32_t lk)
DBUG_ASSERT
(
writer
.
is_locked
());
DBUG_ASSERT
(
lk
);
DBUG_ASSERT
(
lk
<
WRITER
);
if
(
spinloop
)
{
const
unsigned
delay
=
srw_pause_delay
();
for
(
auto
spin
=
srv_n_spin_wait_rounds
;
spin
;
spin
--
)
{
srw_pause
(
delay
);
lk
=
readers
.
load
(
std
::
memory_order_acquire
);
if
(
lk
==
WRITER
)
return
;
DBUG_ASSERT
(
lk
>
WRITER
);
}
}
lk
|=
WRITER
;
do
{
DBUG_ASSERT
(
lk
>
WRITER
);
...
...
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