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
2de95f7a
Commit
2de95f7a
authored
Nov 25, 2020
by
Vladislav Vaintroub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix misspelling.
Kudos to Marko for finding.
parent
af98fddc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
tpool/tpool_generic.cc
tpool/tpool_generic.cc
+11
-11
No files found.
tpool/tpool_generic.cc
View file @
2de95f7a
...
...
@@ -230,19 +230,19 @@ class thread_pool_generic : public thread_pool
/** Maximimum number of threads in this pool. */
unsigned
int
m_max_threads
;
/*
Maintainence related statistics (see maintaine
nce()) */
/*
maintenance related statistics (see maintena
nce()) */
size_t
m_last_thread_count
;
unsigned
long
long
m_last_activity
;
std
::
unique_ptr
<
timer
>
m_maint
ai
nce_timer_task
;
std
::
unique_ptr
<
timer
>
m_maint
ena
nce_timer_task
;
void
worker_main
(
worker_data
*
thread_data
);
void
worker_end
(
worker_data
*
thread_data
);
/* Checks threadpool responsiveness, adjusts thread_counts */
void
maint
aine
nce
();
static
void
maint
aine
nce_func
(
void
*
arg
)
void
maint
ena
nce
();
static
void
maint
ena
nce_func
(
void
*
arg
)
{
((
thread_pool_generic
*
)
arg
)
->
maint
aine
nce
();
((
thread_pool_generic
*
)
arg
)
->
maint
ena
nce
();
}
bool
add_thread
();
bool
wake
(
worker_wake_reason
reason
,
task
*
t
=
nullptr
);
...
...
@@ -528,11 +528,11 @@ void thread_pool_generic::worker_main(worker_data *thread_var)
Periodic job to fix thread count and concurrency,
in case of long tasks, etc
*/
void
thread_pool_generic
::
maint
aine
nce
()
void
thread_pool_generic
::
maint
ena
nce
()
{
/*
If pool is busy (i.e the its mutex is currently locked), we can
skip the maint
aine
nce task, some times, to lower mutex contention
skip the maint
ena
nce task, some times, to lower mutex contention
*/
static
int
skip_counter
;
const
int
MAX_SKIPS
=
10
;
...
...
@@ -691,7 +691,7 @@ thread_pool_generic::thread_pool_generic(int min_threads, int max_threads) :
m_max_threads
(
max_threads
),
m_last_thread_count
(),
m_last_activity
(),
m_maint
ai
nce_timer_task
()
m_maint
ena
nce_timer_task
()
{
if
(
m_max_threads
<
m_concurrency
)
...
...
@@ -703,8 +703,8 @@ thread_pool_generic::thread_pool_generic(int min_threads, int max_threads) :
if
(
min_threads
<
max_threads
)
{
m_maint
aince_timer_task
.
reset
(
new
timer_generic
(
thread_pool_generic
::
maintaine
nce_func
,
this
,
nullptr
));
m_maint
ai
nce_timer_task
->
set_time
((
int
)
m_timer_interval
.
count
(),
(
int
)
m_timer_interval
.
count
());
m_maint
enance_timer_task
.
reset
(
new
timer_generic
(
thread_pool_generic
::
maintena
nce_func
,
this
,
nullptr
));
m_maint
ena
nce_timer_task
->
set_time
((
int
)
m_timer_interval
.
count
(),
(
int
)
m_timer_interval
.
count
());
}
}
...
...
@@ -792,7 +792,7 @@ thread_pool_generic::~thread_pool_generic()
m_aio
.
reset
();
/* Also stop the maintanence task early. */
m_maint
ai
nce_timer_task
.
reset
();
m_maint
ena
nce_timer_task
.
reset
();
std
::
unique_lock
<
std
::
mutex
>
lk
(
m_mtx
);
m_in_shutdown
=
true
;
...
...
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