Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3008)

Unified Diff: base/threading/simple_thread.h

Issue 2218983003: Force non-joinable SimpleThreads to be leaked. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@f1_eatsecondparam_expectdcheckdeath
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/threading/simple_thread.cc » ('j') | base/threading/simple_thread_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/simple_thread.h
diff --git a/base/threading/simple_thread.h b/base/threading/simple_thread.h
index dd1fc6c18e6d4f250e2757e1e0adbabade1ec6ff..f06a3169c2e7e193e10b95216b6c515367634867 100644
--- a/base/threading/simple_thread.h
+++ b/base/threading/simple_thread.h
@@ -74,9 +74,14 @@ class BASE_EXPORT SimpleThread : public PlatformThread::Delegate {
ThreadPriority priority = ThreadPriority::NORMAL;
- // If false, the thread's PlatformThreadHandle will not be kept around and
- // the SimpleThread instance will not be required to be Join()'ed before
- // being destroyed
+ // If false, the underlying thread's PlatformThreadHandle will not be kept
+ // around and as such the SimpleThread instance will not be Join()able and
+ // will have to be leaked. Useful for threads that want to have
+ // TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN semantics. Note: leaking a
+ // joinable thread would effictively have the same semantics, but making it
+ // non-joinable is cleaner as not keeping the PlatformThreadHandle around
+ // has the advantage of letting the system release resources associated with
+ // the thread immediately when it returns from ThreadMain().
bool joinable = true;
};
« no previous file with comments | « no previous file | base/threading/simple_thread.cc » ('j') | base/threading/simple_thread_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698