Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
android_frameworks_native
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
halogenOS
android_frameworks_native
Commits
1d708572
Commit
1d708572
authored
11 months ago
by
Prabir Pradhan
Committed by
Android (Google) Code Review
11 months ago
Browse files
Options
Downloads
Plain Diff
Merge "InputTracer: Ensure tracer thread is destructed first" into main
parents
a11d3545
1cdb2fab
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
services/inputflinger/dispatcher/trace/ThreadedBackend.cpp
+3
-3
3 additions, 3 deletions
services/inputflinger/dispatcher/trace/ThreadedBackend.cpp
services/inputflinger/dispatcher/trace/ThreadedBackend.h
+5
-1
5 additions, 1 deletion
services/inputflinger/dispatcher/trace/ThreadedBackend.h
with
8 additions
and
4 deletions
services/inputflinger/dispatcher/trace/ThreadedBackend.cpp
+
3
−
3
View file @
1d708572
...
...
@@ -38,10 +38,10 @@ struct Visitor : V... {
template
<
typename
Backend
>
ThreadedBackend
<
Backend
>::
ThreadedBackend
(
Backend
&&
innerBackend
)
:
mTracerThread
(
:
mBackend
(
std
::
move
(
innerBackend
)),
mTracerThread
(
"InputTracer"
,
[
this
]()
{
threadLoop
();
},
[
this
]()
{
mThreadWakeCondition
.
notify_all
();
}),
mBackend
(
std
::
move
(
innerBackend
))
{}
[
this
]()
{
mThreadWakeCondition
.
notify_all
();
})
{}
template
<
typename
Backend
>
ThreadedBackend
<
Backend
>::~
ThreadedBackend
()
{
...
...
This diff is collapsed.
Click to expand it.
services/inputflinger/dispatcher/trace/ThreadedBackend.h
+
5
−
1
View file @
1d708572
...
...
@@ -44,7 +44,6 @@ public:
private:
std
::
mutex
mLock
;
InputThread
mTracerThread
;
bool
mThreadExit
GUARDED_BY
(
mLock
){
false
};
std
::
condition_variable
mThreadWakeCondition
;
Backend
mBackend
;
...
...
@@ -53,6 +52,11 @@ private:
TracedEventArgs
>
;
std
::
vector
<
TraceEntry
>
mQueue
GUARDED_BY
(
mLock
);
// InputThread stops when its destructor is called. Initialize it last so that it is the
// first thing to be destructed. This will guarantee the thread will not access other
// members that have already been destructed.
InputThread
mTracerThread
;
void
threadLoop
();
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment