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
1a3ce7e7
Commit
1a3ce7e7
authored
Sep 04, 2020
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-23651: Fix the Windows build
In the Microsoft environment, my_atomic requires int32.
parent
a7dd7c89
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
storage/innobase/include/fil0fil.h
storage/innobase/include/fil0fil.h
+8
-8
No files found.
storage/innobase/include/fil0fil.h
View file @
1a3ce7e7
...
...
@@ -142,11 +142,11 @@ struct fil_space_t : ilist_node<unflushed_spaces_tag_t>,
The most significant bit contains the STOP_NEW_OPS flag.
Protected by my_atomic. */
uint32_t
n_pending_ops
;
int32
n_pending_ops
;
/** Flag in n_pending_ops that indicates that the tablespace is being
deleted, and no further operations should be performed */
static
const
uint32_t
STOP_NEW_OPS
=
1U
<<
31
;
static
const
int32
STOP_NEW_OPS
=
1
<<
31
;
public:
/** Number of pending block read or write operations
(when a write is imminent or a read has recently completed).
...
...
@@ -263,13 +263,13 @@ struct fil_space_t : ilist_node<unflushed_spaces_tag_t>,
void
close
();
/** @return whether the tablespace is about to be dropped or is referenced */
uint32_t
is_stopping_or_referenced
()
int32
is_stopping_or_referenced
()
{
return
my_atomic_load32
(
&
n_pending_ops
);
}
/** @return whether the tablespace is about to be dropped or is referenced */
uint32_t
is_stopping_or_referenced
()
const
int32
is_stopping_or_referenced
()
const
{
return
const_cast
<
fil_space_t
*>
(
this
)
->
is_stopping_or_referenced
();
}
...
...
@@ -281,7 +281,7 @@ struct fil_space_t : ilist_node<unflushed_spaces_tag_t>,
}
/** @return number of references being held */
uint32_t
referenced
()
const
int32
referenced
()
const
{
return
is_stopping_or_referenced
()
&
~
STOP_NEW_OPS
;
}
...
...
@@ -290,7 +290,7 @@ struct fil_space_t : ilist_node<unflushed_spaces_tag_t>,
void
set_stopping
(
bool
stopping
)
{
/* Note: starting with 10.4 this should be std::atomic::fetch_xor() */
uint32_t
n
=
stopping
?
0
:
STOP_NEW_OPS
;
int32
n
=
stopping
?
0
:
STOP_NEW_OPS
;
while
(
!
my_atomic_cas32_strong_explicit
(
&
n_pending_ops
,
&
n
,
n
^
STOP_NEW_OPS
,
MY_MEMORY_ORDER_ACQUIRE
,
...
...
@@ -302,7 +302,7 @@ struct fil_space_t : ilist_node<unflushed_spaces_tag_t>,
/** @return whether a tablespace reference was successfully acquired */
bool
acquire
()
{
uint32_t
n
=
0
;
int32
n
=
0
;
while
(
!
my_atomic_cas32_strong_explicit
(
&
n_pending_ops
,
&
n
,
n
+
1
,
MY_MEMORY_ORDER_ACQUIRE
,
MY_MEMORY_ORDER_RELAXED
))
...
...
@@ -314,7 +314,7 @@ struct fil_space_t : ilist_node<unflushed_spaces_tag_t>,
@return whether this was the last reference */
bool
release
()
{
uint32_t
n
=
my_atomic_add32
(
&
n_pending_ops
,
uint32_t
(
-
1
)
);
int32
n
=
my_atomic_add32
(
&
n_pending_ops
,
-
1
);
ut_ad
(
n
&
~
STOP_NEW_OPS
);
return
(
n
&
~
STOP_NEW_OPS
)
==
1
;
}
...
...
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