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

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

Issue 796063006: Rename Thread -> OSThread. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/os_thread_win.cc ('k') | runtime/vm/pages.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 "vm/globals.h" 5 #include "vm/globals.h"
6 #if defined(TARGET_OS_WINDOWS) 6 #if defined(TARGET_OS_WINDOWS)
7 7
8 #include "vm/os.h" 8 #include "vm/os.h"
9 9
10 #include <malloc.h> // NOLINT 10 #include <malloc.h> // NOLINT
11 #include <process.h> // NOLINT 11 #include <process.h> // NOLINT
12 #include <time.h> // NOLINT 12 #include <time.h> // NOLINT
13 13
14 #include "platform/utils.h" 14 #include "platform/utils.h"
15 #include "platform/assert.h" 15 #include "platform/assert.h"
16 #include "vm/thread.h" 16 #include "vm/os_thread.h"
17 #include "vm/vtune.h" 17 #include "vm/vtune.h"
18 18
19 namespace dart { 19 namespace dart {
20 20
21 const char* OS::Name() { 21 const char* OS::Name() {
22 return "windows"; 22 return "windows";
23 } 23 }
24 24
25 25
26 intptr_t OS::ProcessId() { 26 intptr_t OS::ProcessId() {
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 int OS::VSNPrint(char* str, size_t size, const char* format, va_list args) { 240 int OS::VSNPrint(char* str, size_t size, const char* format, va_list args) {
241 if (str == NULL || size == 0) { 241 if (str == NULL || size == 0) {
242 int retval = _vscprintf(format, args); 242 int retval = _vscprintf(format, args);
243 if (retval < 0) { 243 if (retval < 0) {
244 FATAL1("Fatal error in OS::VSNPrint with format '%s'", format); 244 FATAL1("Fatal error in OS::VSNPrint with format '%s'", format);
245 } 245 }
246 return retval; 246 return retval;
247 } 247 }
248 va_list args_copy; 248 va_list args_copy;
249 va_copy(args_copy, args); 249 va_copy(args_copy, args);
250 int written =_vsnprintf(str, size, format, args_copy); 250 int written = _vsnprintf(str, size, format, args_copy);
251 va_end(args_copy); 251 va_end(args_copy);
252 if (written < 0) { 252 if (written < 0) {
253 // _vsnprintf returns -1 if the number of characters to be written is 253 // _vsnprintf returns -1 if the number of characters to be written is
254 // larger than 'size', so we call _vscprintf which returns the number 254 // larger than 'size', so we call _vscprintf which returns the number
255 // of characters that would have been written. 255 // of characters that would have been written.
256 va_list args_retry; 256 va_list args_retry;
257 va_copy(args_retry, args); 257 va_copy(args_retry, args);
258 written = _vscprintf(format, args_retry); 258 written = _vscprintf(format, args_retry);
259 if (written < 0) { 259 if (written < 0) {
260 FATAL1("Fatal error in OS::VSNPrint with format '%s'", format); 260 FATAL1("Fatal error in OS::VSNPrint with format '%s'", format);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 308
309 void OS::InitOnce() { 309 void OS::InitOnce() {
310 // TODO(5411554): For now we check that initonce is called only once, 310 // TODO(5411554): For now we check that initonce is called only once,
311 // Once there is more formal mechanism to call InitOnce we can move 311 // Once there is more formal mechanism to call InitOnce we can move
312 // this check there. 312 // this check there.
313 static bool init_once_called = false; 313 static bool init_once_called = false;
314 ASSERT(init_once_called == false); 314 ASSERT(init_once_called == false);
315 init_once_called = true; 315 init_once_called = true;
316 // Do not pop up a message box when abort is called. 316 // Do not pop up a message box when abort is called.
317 _set_abort_behavior(0, _WRITE_ABORT_MSG); 317 _set_abort_behavior(0, _WRITE_ABORT_MSG);
318 MonitorWaitData::monitor_wait_data_key_ = Thread::CreateThreadLocal(); 318 MonitorWaitData::monitor_wait_data_key_ = OSThread::CreateThreadLocal();
319 MonitorData::GetMonitorWaitDataForThread(); 319 MonitorData::GetMonitorWaitDataForThread();
320 } 320 }
321 321
322 322
323 void OS::Shutdown() { 323 void OS::Shutdown() {
324 } 324 }
325 325
326 326
327 void OS::Abort() { 327 void OS::Abort() {
328 abort(); 328 abort();
329 } 329 }
330 330
331 331
332 void OS::Exit(int code) { 332 void OS::Exit(int code) {
333 exit(code); 333 exit(code);
334 } 334 }
335 335
336 } // namespace dart 336 } // namespace dart
337 337
338 #endif // defined(TARGET_OS_WINDOWS) 338 #endif // defined(TARGET_OS_WINDOWS)
OLDNEW
« no previous file with comments | « runtime/vm/os_thread_win.cc ('k') | runtime/vm/pages.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698