Index: base/platform_thread_win.cc |
=================================================================== |
--- base/platform_thread_win.cc (revision 4461) |
+++ base/platform_thread_win.cc (working copy) |
@@ -22,7 +22,7 @@ |
DWORD dwFlags; // Reserved for future use, must be zero. |
} THREADNAME_INFO; |
-unsigned __stdcall ThreadFunc(void* closure) { |
+DWORD __stdcall ThreadFunc(void* closure) { |
PlatformThread::Delegate* delegate = |
static_cast<PlatformThread::Delegate*>(closure); |
delegate->ThreadMain(); |
@@ -50,7 +50,7 @@ |
void PlatformThread::SetName(const char* name) { |
// The debugger needs to be around to catch the name in the exception. If |
// there isn't a debugger, we are just needlessly throwing an exception. |
- if (!::IsDebuggerPresent()) |
+ if (0 && !::IsDebuggerPresent()) |
Peter Kasting
2008/11/03 22:09:32
Did you mean this change to be part of this CL? L
|
return; |
THREADNAME_INFO info; |
@@ -76,8 +76,13 @@ |
stack_size = 0; |
} |
- *thread_handle = reinterpret_cast<PlatformThreadHandle>(_beginthreadex( |
- NULL, stack_size, ThreadFunc, delegate, flags, NULL)); |
+ // Using CreateThread here vs _beginthreadex makes thread creation a bit |
+ // faster and doesn't require holding the loader lock. Our code will have |
tommi (sloooow) - chröme
2008/11/30 05:29:33
hi... really late, drive by comment here. I notic
|
+ // to work running on CreateThread() threads anyway, since we run code on |
+ // the Windows thread pool, etc. For some background on the difference: |
+ // http://www.microsoft.com/msj/1099/win32/win321099.aspx |
M-A Ruel
2008/11/03 22:22:11
Add these links too:
http://msdn.microsoft.com/en-
|
+ *thread_handle = CreateThread( |
+ NULL, stack_size, ThreadFunc, delegate, flags, NULL); |
return *thread_handle != NULL; |
} |