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

Unified Diff: base/threading/platform_thread_win.cc

Issue 2790473006: Replace IOAllowed with WaitAllowed in PlatformThread::Join()
Patch Set: allow in IOThreadPreCleanup() Created 3 years, 8 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 | « base/threading/platform_thread_posix.cc ('k') | base/threading/thread_restrictions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/platform_thread_win.cc
diff --git a/base/threading/platform_thread_win.cc b/base/threading/platform_thread_win.cc
index e271fe8225545e14db5738f9cb8a7f9c7dd1d7cf..289aebf9b78edaf4b374d881e3a928a435b998fa 100644
--- a/base/threading/platform_thread_win.cc
+++ b/base/threading/platform_thread_win.cc
@@ -225,18 +225,15 @@ bool PlatformThread::CreateNonJoinableWithPriority(size_t stack_size,
// static
void PlatformThread::Join(PlatformThreadHandle thread_handle) {
- // Record the event that this thread is blocking upon (for hang diagnosis).
- base::debug::ScopedThreadJoinActivity thread_activity(&thread_handle);
-
DCHECK(thread_handle.platform_handle());
- // TODO(willchan): Enable this check once I can get it to work for Windows
- // shutdown.
+
// Joining another thread may block the current thread for a long time, since
// the thread referred to by |thread_handle| may still be running long-lived /
// blocking tasks.
-#if 0
- base::ThreadRestrictions::AssertIOAllowed();
-#endif
+ base::ThreadRestrictions::AssertWaitAllowed();
+
+ // Record the event that this thread is blocking upon (for hang diagnosis).
+ base::debug::ScopedThreadJoinActivity thread_activity(&thread_handle);
// Wait for the thread to exit. It should already have terminated but make
// sure this assumption is valid.
« no previous file with comments | « base/threading/platform_thread_posix.cc ('k') | base/threading/thread_restrictions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698