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

Side by Side Diff: runtime/bin/platform_win.cc

Issue 1416063005: Hack around TLS destructors firing after the process exits (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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 | « no previous file | runtime/bin/run_vm_tests.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) 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" 5 #include "platform/globals.h"
6 #if defined(TARGET_OS_WINDOWS) 6 #if defined(TARGET_OS_WINDOWS)
7 7
8 #include "bin/file.h" 8 #include "bin/file.h"
9 #include "bin/platform.h" 9 #include "bin/platform.h"
10 #include "bin/log.h" 10 #include "bin/log.h"
11 #include "bin/socket.h" 11 #include "bin/socket.h"
12 #include "bin/utils.h" 12 #include "bin/utils.h"
13 #include "bin/utils_win.h" 13 #include "bin/utils_win.h"
14 14
15 15
16 namespace dart { 16 namespace dart {
17
18 // Defined in vm/os_thread_win.cc
19 extern bool private_flag_windows_run_tls_destructors;
20
17 namespace bin { 21 namespace bin {
18 22
19 bool Platform::Initialize() { 23 bool Platform::Initialize() {
20 // Nothing to do on Windows. 24 // Nothing to do on Windows.
21 return true; 25 return true;
22 } 26 }
23 27
24 28
25 int Platform::NumberOfProcessors() { 29 int Platform::NumberOfProcessors() {
26 SYSTEM_INFO info; 30 SYSTEM_INFO info;
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 } 103 }
100 char* path = StringUtilsWin::WideToUtf8(tmp_buffer); 104 char* path = StringUtilsWin::WideToUtf8(tmp_buffer);
101 free(tmp_buffer); 105 free(tmp_buffer);
102 // Return the canonical path as the returned path might contain symlinks. 106 // Return the canonical path as the returned path might contain symlinks.
103 char* canon_path = File::GetCanonicalPath(path); 107 char* canon_path = File::GetCanonicalPath(path);
104 free(path); 108 free(path);
105 return canon_path; 109 return canon_path;
106 } 110 }
107 111
108 void Platform::Exit(int exit_code) { 112 void Platform::Exit(int exit_code) {
113 ::dart::private_flag_windows_run_tls_destructors = false;
109 // On Windows we use ExitProcess so that threads can't clobber the exit_code. 114 // On Windows we use ExitProcess so that threads can't clobber the exit_code.
110 // See: https://code.google.com/p/nativeclient/issues/detail?id=2870 115 // See: https://code.google.com/p/nativeclient/issues/detail?id=2870
111 ::ExitProcess(exit_code); 116 ::ExitProcess(exit_code);
112 } 117 }
113 118
114 } // namespace bin 119 } // namespace bin
115 } // namespace dart 120 } // namespace dart
116 121
117 #endif // defined(TARGET_OS_WINDOWS) 122 #endif // defined(TARGET_OS_WINDOWS)
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/run_vm_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698