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

Side by Side Diff: base/platform_thread_win.cc

Issue 5750003: Reland r68893 after fixing allowing blocking IO on shutdown. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disable for Windows. Created 10 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/platform_thread_posix.cc ('k') | chrome/browser/browser_process_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/platform_thread.h" 5 #include "base/platform_thread.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/thread_restrictions.h" 8 #include "base/thread_restrictions.h"
9 #include "base/win/windows_version.h" 9 #include "base/win/windows_version.h"
10 10
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 } 118 }
119 119
120 // static 120 // static
121 bool PlatformThread::CreateNonJoinable(size_t stack_size, Delegate* delegate) { 121 bool PlatformThread::CreateNonJoinable(size_t stack_size, Delegate* delegate) {
122 return CreateThreadInternal(stack_size, delegate, NULL); 122 return CreateThreadInternal(stack_size, delegate, NULL);
123 } 123 }
124 124
125 // static 125 // static
126 void PlatformThread::Join(PlatformThreadHandle thread_handle) { 126 void PlatformThread::Join(PlatformThreadHandle thread_handle) {
127 DCHECK(thread_handle); 127 DCHECK(thread_handle);
128 // TODO(willchan): Enable this check once I can get it to work for Windows
129 // shutdown.
130 // Joining another thread may block the current thread for a long time, since
131 // the thread referred to by |thread_handle| may still be running long-lived /
132 // blocking tasks.
133 #if 0
134 base::ThreadRestrictions::AssertIOAllowed();
135 #endif
128 136
129 // Wait for the thread to exit. It should already have terminated but make 137 // Wait for the thread to exit. It should already have terminated but make
130 // sure this assumption is valid. 138 // sure this assumption is valid.
131 DWORD result = WaitForSingleObject(thread_handle, INFINITE); 139 DWORD result = WaitForSingleObject(thread_handle, INFINITE);
132 DCHECK_EQ(WAIT_OBJECT_0, result); 140 DCHECK_EQ(WAIT_OBJECT_0, result);
133 141
134 CloseHandle(thread_handle); 142 CloseHandle(thread_handle);
135 } 143 }
OLDNEW
« no previous file with comments | « base/platform_thread_posix.cc ('k') | chrome/browser/browser_process_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698