-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ScopedJobThreadPtr class to be used with JobThread #4275
base: 25.lts.1+
Are you sure you want to change the base?
Conversation
} | ||
} | ||
|
||
void JobThread::JoinThread() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are adding a new convention to JobThread
, that JoinThread()
has to be called prior to destruction.
We could handle this situation better by introducing a new class (e.g. JobThreadHolder
) that holds an JobThread object, keeps itself valid before destroying the underlying JobThread. Once the new class is implemented, turn the dtor of JobThread into private and a friend of the new class, so other teammates won't accidentally wrap a JobThread into a std::unique_ptr<>.
We should then revert all previous changes that call ScheduleAndWait() before destroying the JobThread.
67a8d3b
to
30e7e60
Compare
@borongc is it possible for you to help me review the part in this PR where all changes to Schedule() made during the scoped_ptr<> to unique_ptr<> migration is reverted? |
30e7e60
to
5a37123
Compare
b/372515171