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
98a7fa0c
Commit
98a7fa0c
authored
Oct 02, 2021
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-26720: optimize rw_lock for IA-32, AMD64
parent
be803f03
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
storage/innobase/include/rw_lock.h
storage/innobase/include/rw_lock.h
+11
-1
No files found.
storage/innobase/include/rw_lock.h
View file @
98a7fa0c
...
...
@@ -38,7 +38,17 @@ class rw_lock
/** Start waiting for an exclusive lock. */
void
write_lock_wait_start
()
{
lock
.
fetch_or
(
WRITER_WAITING
,
std
::
memory_order_relaxed
);
}
{
#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
}
/** Try to acquire a shared lock.
@param l the value of the lock word
@return whether the lock was acquired */
...
...
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