| 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 #include "vm/vtune.h" | 9 #include "vm/vtune.h" |
| 10 | 10 |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 | 309 |
| 310 void OS::InitOnce() { | 310 void OS::InitOnce() { |
| 311 // 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, |
| 312 // 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 |
| 313 // this check there. | 313 // this check there. |
| 314 static bool init_once_called = false; | 314 static bool init_once_called = false; |
| 315 ASSERT(init_once_called == false); | 315 ASSERT(init_once_called == false); |
| 316 init_once_called = true; | 316 init_once_called = true; |
| 317 // Do not pop up a message box when abort is called. | 317 // Do not pop up a message box when abort is called. |
| 318 _set_abort_behavior(0, _WRITE_ABORT_MSG); | 318 _set_abort_behavior(0, _WRITE_ABORT_MSG); |
| 319 ThreadInlineImpl::thread_id_key = Thread::CreateThreadLocal(); | |
| 320 MonitorWaitData::monitor_wait_data_key_ = Thread::CreateThreadLocal(); | 319 MonitorWaitData::monitor_wait_data_key_ = Thread::CreateThreadLocal(); |
| 321 MonitorData::GetMonitorWaitDataForThread(); | 320 MonitorData::GetMonitorWaitDataForThread(); |
| 322 ThreadId thread_id = ThreadInlineImpl::CreateThreadId(); | |
| 323 Thread::SetThreadLocal(ThreadInlineImpl::thread_id_key, | |
| 324 reinterpret_cast<DWORD>(thread_id)); | |
| 325 } | 321 } |
| 326 | 322 |
| 327 | 323 |
| 328 void OS::Shutdown() { | 324 void OS::Shutdown() { |
| 329 } | 325 } |
| 330 | 326 |
| 331 | 327 |
| 332 void OS::Abort() { | 328 void OS::Abort() { |
| 333 abort(); | 329 abort(); |
| 334 } | 330 } |
| 335 | 331 |
| 336 | 332 |
| 337 void OS::Exit(int code) { | 333 void OS::Exit(int code) { |
| 338 exit(code); | 334 exit(code); |
| 339 } | 335 } |
| 340 | 336 |
| 341 } // namespace dart | 337 } // namespace dart |
| 342 | 338 |
| 343 #endif // defined(TARGET_OS_WINDOWS) | 339 #endif // defined(TARGET_OS_WINDOWS) |
| OLD | NEW |