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

Side by Side Diff: runtime/vm/os_thread_win.cc

Issue 1537543002: Fix for issue 25236 (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: code-review-comments Created 5 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
« no previous file with comments | « runtime/vm/os_thread_macos.cc ('k') | runtime/vm/thread.h » ('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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "platform/globals.h" // NOLINT 5 #include "platform/globals.h" // NOLINT
6 #if defined(TARGET_OS_WINDOWS) 6 #if defined(TARGET_OS_WINDOWS)
7 7
8 #include "vm/growable_array.h" 8 #include "vm/growable_array.h"
9 #include "vm/os_thread.h" 9 #include "vm/os_thread.h"
10 10
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 ThreadStartData* data = reinterpret_cast<ThreadStartData*>(data_ptr); 45 ThreadStartData* data = reinterpret_cast<ThreadStartData*>(data_ptr);
46 46
47 const char* name = data->name(); 47 const char* name = data->name();
48 OSThread::ThreadStartFunction function = data->function(); 48 OSThread::ThreadStartFunction function = data->function();
49 uword parameter = data->parameter(); 49 uword parameter = data->parameter();
50 delete data; 50 delete data;
51 51
52 MonitorData::GetMonitorWaitDataForThread(); 52 MonitorData::GetMonitorWaitDataForThread();
53 53
54 // Create new OSThread object and set as TLS for new thread. 54 // Create new OSThread object and set as TLS for new thread.
55 OSThread* thread = new OSThread(); 55 OSThread* thread = OSThread::CreateOSThread();
56 OSThread::SetCurrent(thread); 56 if (thread != NULL) {
57 thread->set_name(name); 57 OSThread::SetCurrent(thread);
58 thread->set_name(name);
58 59
59 // Call the supplied thread start function handing it its parameters. 60 // Call the supplied thread start function handing it its parameters.
60 function(parameter); 61 function(parameter);
62 }
61 63
62 // Clean up the monitor wait data for this thread. 64 // Clean up the monitor wait data for this thread.
63 MonitorWaitData::ThreadExit(); 65 MonitorWaitData::ThreadExit();
64 66
65 return 0; 67 return 0;
66 } 68 }
67 69
68 70
69 int OSThread::Start(const char* name, 71 int OSThread::Start(const char* name,
70 ThreadStartFunction function, 72 ThreadStartFunction function,
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 #pragma data_seg(".CRT$XLB") 698 #pragma data_seg(".CRT$XLB")
697 PIMAGE_TLS_CALLBACK p_thread_callback_dart = OnDartThreadExit; 699 PIMAGE_TLS_CALLBACK p_thread_callback_dart = OnDartThreadExit;
698 700
699 // Reset the default section. 701 // Reset the default section.
700 #pragma data_seg() 702 #pragma data_seg()
701 703
702 #endif // _WIN64 704 #endif // _WIN64
703 } // extern "C" 705 } // extern "C"
704 706
705 #endif // defined(TARGET_OS_WINDOWS) 707 #endif // defined(TARGET_OS_WINDOWS)
OLDNEW
« no previous file with comments | « runtime/vm/os_thread_macos.cc ('k') | runtime/vm/thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698