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
295689cc
Commit
295689cc
authored
Mar 13, 2023
by
Nikita Malyavin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
APC: support waking up sleeping threads;
parent
0d104bae
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
4 deletions
+12
-4
sql/my_apc.cc
sql/my_apc.cc
+8
-1
sql/sql_class.cc
sql/sql_class.cc
+2
-2
sql/sql_class.h
sql/sql_class.h
+1
-1
storage/perfschema/pfs_variable.cc
storage/perfschema/pfs_variable.cc
+1
-0
No files found.
sql/my_apc.cc
View file @
295689cc
...
...
@@ -133,9 +133,9 @@ int Apc_target::wait_for_completion(THD *caller_thd, Call_request *apc_request,
int
wait_res
=
0
;
PSI_stage_info
old_stage
;
mysql_mutex_lock
(
&
apc_request
->
LOCK_request
);
mysql_mutex_unlock
(
LOCK_thd_kill_ptr
);
mysql_mutex_lock
(
&
apc_request
->
LOCK_request
);
caller_thd
->
ENTER_COND
(
&
apc_request
->
COND_request
,
&
apc_request
->
LOCK_request
,
&
stage_show_explain
,
&
old_stage
);
/* todo: how about processing other errors here? */
...
...
@@ -145,6 +145,13 @@ int Apc_target::wait_for_completion(THD *caller_thd, Call_request *apc_request,
&
apc_request
->
LOCK_request
,
&
abstime
);
if
(
caller_thd
->
killed
)
break
;
if
(
caller_thd
->
apc_target
.
have_apc_requests
())
{
mysql_mutex_unlock
(
&
apc_request
->
LOCK_request
);
caller_thd
->
apc_target
.
process_apc_requests
();
mysql_mutex_lock
(
&
apc_request
->
LOCK_request
);
}
}
if
(
!
apc_request
->
processed
)
...
...
sql/sql_class.cc
View file @
295689cc
...
...
@@ -1910,13 +1910,13 @@ void THD::awake_no_mutex(killed_state state_to_set)
}
/* Broadcast a condition to kick the target if it is waiting on it. */
void
THD
::
abort_current_cond_wait
(
bool
force
)
void
THD
::
abort_current_cond_wait
(
bool
force
,
bool
mark_abort
)
{
mysql_mutex_assert_owner
(
&
LOCK_thd_kill
);
if
(
mysys_var
)
{
mysql_mutex_lock
(
&
mysys_var
->
mutex
);
if
(
!
system_thread
||
force
)
// Don't abort locks
if
(
mark_abort
&&
(
!
system_thread
||
force
))
// Don't abort locks
mysys_var
->
abort
=
1
;
/*
...
...
sql/sql_class.h
View file @
295689cc
...
...
@@ -3795,7 +3795,7 @@ class THD: public THD_count, /* this must be first */
mysql_mutex_unlock
(
&
LOCK_thd_data
);
mysql_mutex_unlock
(
&
LOCK_thd_kill
);
}
void
abort_current_cond_wait
(
bool
force
);
void
abort_current_cond_wait
(
bool
force
,
bool
mark_abort
=
true
);
/** Disconnect the associated communication endpoint. */
void
disconnect
();
...
...
storage/perfschema/pfs_variable.cc
View file @
295689cc
...
...
@@ -397,6 +397,7 @@ int PFS_system_variable_cache::make_call(Request_func func, uint param)
PFS_system_variable_cache_apc
apc_call
(
this
,
func
,
param
);
auto
*
request
=
new
Apc_target
::
Call_request
;
m_safe_thd
->
apc_target
.
enqueue_request
(
request
,
&
apc_call
);
m_safe_thd
->
abort_current_cond_wait
(
false
,
false
);
m_safe_thd
->
scheduler
->
notify_apc
(
m_safe_thd
);
DEBUG_SYNC
(
requestor_thd
,
"apc_after_notify"
);
ret
=
m_safe_thd
->
apc_target
.
wait_for_completion
(
requestor_thd
,
request
,
10
);
...
...
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