| 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 |
| 11 #include <process.h> // NOLINT | 11 #include <process.h> // NOLINT |
| 12 #include <time.h> // NOLINT | 12 #include <time.h> // NOLINT |
| 13 | 13 |
| 14 // TODO(iposva): Move this out to bin/thread initialization. |
| 15 #include "bin/thread.h" |
| 16 |
| 14 #include "platform/utils.h" | 17 #include "platform/utils.h" |
| 15 #include "platform/assert.h" | 18 #include "platform/assert.h" |
| 16 #include "vm/thread.h" | 19 #include "vm/thread.h" |
| 17 #include "vm/vtune.h" | 20 #include "vm/vtune.h" |
| 18 | 21 |
| 19 namespace dart { | 22 namespace dart { |
| 20 | 23 |
| 21 const char* OS::Name() { | 24 const char* OS::Name() { |
| 22 return "windows"; | 25 return "windows"; |
| 23 } | 26 } |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 // TODO(5411554): For now we check that initonce is called only once, | 311 // TODO(5411554): For now we check that initonce is called only once, |
| 309 // Once there is more formal mechanism to call InitOnce we can move | 312 // Once there is more formal mechanism to call InitOnce we can move |
| 310 // this check there. | 313 // this check there. |
| 311 static bool init_once_called = false; | 314 static bool init_once_called = false; |
| 312 ASSERT(init_once_called == false); | 315 ASSERT(init_once_called == false); |
| 313 init_once_called = true; | 316 init_once_called = true; |
| 314 // Do not pop up a message box when abort is called. | 317 // Do not pop up a message box when abort is called. |
| 315 _set_abort_behavior(0, _WRITE_ABORT_MSG); | 318 _set_abort_behavior(0, _WRITE_ABORT_MSG); |
| 316 MonitorWaitData::monitor_wait_data_key_ = Thread::CreateThreadLocal(); | 319 MonitorWaitData::monitor_wait_data_key_ = Thread::CreateThreadLocal(); |
| 317 MonitorData::GetMonitorWaitDataForThread(); | 320 MonitorData::GetMonitorWaitDataForThread(); |
| 321 // TODO(iposva): Move this out to bin/thread initialization. |
| 322 bin::MonitorWaitData::monitor_wait_data_key_ = Thread::CreateThreadLocal(); |
| 323 bin::MonitorData::GetMonitorWaitDataForThread(); |
| 318 } | 324 } |
| 319 | 325 |
| 320 | 326 |
| 321 void OS::Shutdown() { | 327 void OS::Shutdown() { |
| 322 } | 328 } |
| 323 | 329 |
| 324 | 330 |
| 325 void OS::Abort() { | 331 void OS::Abort() { |
| 326 abort(); | 332 abort(); |
| 327 } | 333 } |
| 328 | 334 |
| 329 | 335 |
| 330 void OS::Exit(int code) { | 336 void OS::Exit(int code) { |
| 331 exit(code); | 337 exit(code); |
| 332 } | 338 } |
| 333 | 339 |
| 334 } // namespace dart | 340 } // namespace dart |
| 335 | 341 |
| 336 #endif // defined(TARGET_OS_WINDOWS) | 342 #endif // defined(TARGET_OS_WINDOWS) |
| OLD | NEW |