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
28cb0417
Commit
28cb0417
authored
Feb 20, 2019
by
Eugene Kosov
Committed by
Marko Mäkelä
Feb 21, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-18662 ib_wqueue_t has a data race
ib_wqueue_is_empty(): protect ib_list_is_empty() call Closes #1202
parent
b88a8034
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
40 deletions
+28
-40
storage/innobase/include/ut0wqueue.h
storage/innobase/include/ut0wqueue.h
+5
-10
storage/innobase/ut/ut0wqueue.cc
storage/innobase/ut/ut0wqueue.cc
+9
-10
storage/xtradb/include/ut0wqueue.h
storage/xtradb/include/ut0wqueue.h
+5
-10
storage/xtradb/ut/ut0wqueue.cc
storage/xtradb/ut/ut0wqueue.cc
+9
-10
No files found.
storage/innobase/include/ut0wqueue.h
View file @
28cb0417
/*****************************************************************************
Copyright (c) 2006, 2009, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017,
MariaDB Corporation. All Rights Reserved
.
Copyright (c) 2017,
2019, MariaDB Corporation
.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -67,15 +67,10 @@ ib_wqueue_add(
mem_heap_t
*
heap
);
/*!< in: memory heap to use for allocating the
list node */
/********************************************************************
Check if queue is empty. */
ibool
ib_wqueue_is_empty
(
/*===============*/
/* out: TRUE if queue empty
else FALSE */
const
ib_wqueue_t
*
wq
);
/* in: work queue */
/** Check if queue is empty.
@param wq wait queue
@return whether the queue is empty */
bool
ib_wqueue_is_empty
(
ib_wqueue_t
*
wq
);
/****************************************************************//**
Wait for a work item to appear in the queue.
...
...
storage/innobase/ut/ut0wqueue.cc
View file @
28cb0417
/*****************************************************************************
Copyright (c) 2006, 2011, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -193,17 +194,15 @@ ib_wqueue_nowait(
return
(
node
?
node
->
data
:
NULL
);
}
/********************************************************************
Check if queue is empty. */
ibool
ib_wqueue_is_empty
(
/*===============*/
/* out: TRUE if queue empty
else FALSE */
const
ib_wqueue_t
*
wq
)
/* in: work queue */
/** Check if queue is empty.
@param wq wait queue
@return whether the queue is empty */
bool
ib_wqueue_is_empty
(
ib_wqueue_t
*
wq
)
{
return
(
ib_list_is_empty
(
wq
->
items
));
mutex_enter
(
&
wq
->
mutex
);
bool
is_empty
=
ib_list_is_empty
(
wq
->
items
);
mutex_exit
(
&
wq
->
mutex
);
return
is_empty
;
}
/********************************************************************
...
...
storage/xtradb/include/ut0wqueue.h
View file @
28cb0417
/*****************************************************************************
Copyright (c) 2006, 2009, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017,
MariaDB Corporation. All Rights Reserved
.
Copyright (c) 2017,
2019, MariaDB Corporation
.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -67,15 +67,10 @@ ib_wqueue_add(
mem_heap_t
*
heap
);
/*!< in: memory heap to use for allocating the
list node */
/********************************************************************
Check if queue is empty. */
ibool
ib_wqueue_is_empty
(
/*===============*/
/* out: TRUE if queue empty
else FALSE */
const
ib_wqueue_t
*
wq
);
/* in: work queue */
/** Check if queue is empty.
@param wq wait queue
@return whether the queue is empty */
bool
ib_wqueue_is_empty
(
ib_wqueue_t
*
wq
);
/****************************************************************//**
Wait for a work item to appear in the queue.
...
...
storage/xtradb/ut/ut0wqueue.cc
View file @
28cb0417
/*****************************************************************************
Copyright (c) 2006, 2011, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
...
...
@@ -193,17 +194,15 @@ ib_wqueue_nowait(
return
(
node
?
node
->
data
:
NULL
);
}
/********************************************************************
Check if queue is empty. */
ibool
ib_wqueue_is_empty
(
/*===============*/
/* out: TRUE if queue empty
else FALSE */
const
ib_wqueue_t
*
wq
)
/* in: work queue */
/** Check if queue is empty.
@param wq wait queue
@return whether the queue is empty */
bool
ib_wqueue_is_empty
(
ib_wqueue_t
*
wq
)
{
return
(
ib_list_is_empty
(
wq
->
items
));
mutex_enter
(
&
wq
->
mutex
);
bool
is_empty
=
ib_list_is_empty
(
wq
->
items
);
mutex_exit
(
&
wq
->
mutex
);
return
is_empty
;
}
/********************************************************************
...
...
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