OLD | NEW |
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 |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 | 361 |
362 void OS::InitOnce() { | 362 void OS::InitOnce() { |
363 // TODO(5411554): For now we check that initonce is called only once, | 363 // TODO(5411554): For now we check that initonce is called only once, |
364 // Once there is more formal mechanism to call InitOnce we can move | 364 // Once there is more formal mechanism to call InitOnce we can move |
365 // this check there. | 365 // this check there. |
366 static bool init_once_called = false; | 366 static bool init_once_called = false; |
367 ASSERT(init_once_called == false); | 367 ASSERT(init_once_called == false); |
368 init_once_called = true; | 368 init_once_called = true; |
369 // Do not pop up a message box when abort is called. | 369 // Do not pop up a message box when abort is called. |
370 _set_abort_behavior(0, _WRITE_ABORT_MSG); | 370 _set_abort_behavior(0, _WRITE_ABORT_MSG); |
| 371 ThreadLocalData::InitOnce(); |
371 MonitorWaitData::monitor_wait_data_key_ = OSThread::CreateThreadLocal(); | 372 MonitorWaitData::monitor_wait_data_key_ = OSThread::CreateThreadLocal(); |
372 MonitorData::GetMonitorWaitDataForThread(); | 373 MonitorData::GetMonitorWaitDataForThread(); |
373 LARGE_INTEGER ticks_per_sec; | 374 LARGE_INTEGER ticks_per_sec; |
374 if (!QueryPerformanceFrequency(&ticks_per_sec)) { | 375 if (!QueryPerformanceFrequency(&ticks_per_sec)) { |
375 qpc_ticks_per_second = 0; | 376 qpc_ticks_per_second = 0; |
376 } else { | 377 } else { |
377 qpc_ticks_per_second = static_cast<int64_t>(ticks_per_sec.QuadPart); | 378 qpc_ticks_per_second = static_cast<int64_t>(ticks_per_sec.QuadPart); |
378 } | 379 } |
379 } | 380 } |
380 | 381 |
381 | 382 |
382 void OS::Shutdown() { | 383 void OS::Shutdown() { |
| 384 // TODO(zra): Enable once VM can shutdown cleanly. |
| 385 // ThreadLocalData::Shutdown(); |
383 } | 386 } |
384 | 387 |
385 | 388 |
386 void OS::Abort() { | 389 void OS::Abort() { |
387 abort(); | 390 abort(); |
388 } | 391 } |
389 | 392 |
390 | 393 |
391 void OS::Exit(int code) { | 394 void OS::Exit(int code) { |
392 exit(code); | 395 exit(code); |
393 } | 396 } |
394 | 397 |
395 } // namespace dart | 398 } // namespace dart |
396 | 399 |
397 #endif // defined(TARGET_OS_WINDOWS) | 400 #endif // defined(TARGET_OS_WINDOWS) |
OLD | NEW |