| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Platform-specific code for Win32. | 5 // Platform-specific code for Win32. |
| 6 | 6 |
| 7 // Secure API functions are not available using MinGW with msvcrt.dll | 7 // Secure API functions are not available using MinGW with msvcrt.dll |
| 8 // on Windows XP. Make sure MINGW_HAS_SECURE_API is not defined to | 8 // on Windows XP. Make sure MINGW_HAS_SECURE_API is not defined to |
| 9 // disable definition of secure API functions in standard headers that | 9 // disable definition of secure API functions in standard headers that |
| 10 // would conflict with our own implementation. | 10 // would conflict with our own implementation. |
| (...skipping 1317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1328 // object. The entry function dispatches to the run method in the thread | 1328 // object. The entry function dispatches to the run method in the thread |
| 1329 // object. It is important that this function has __stdcall calling | 1329 // object. It is important that this function has __stdcall calling |
| 1330 // convention. | 1330 // convention. |
| 1331 static unsigned int __stdcall ThreadEntry(void* arg) { | 1331 static unsigned int __stdcall ThreadEntry(void* arg) { |
| 1332 Thread* thread = reinterpret_cast<Thread*>(arg); | 1332 Thread* thread = reinterpret_cast<Thread*>(arg); |
| 1333 thread->NotifyStartedAndRun(); | 1333 thread->NotifyStartedAndRun(); |
| 1334 return 0; | 1334 return 0; |
| 1335 } | 1335 } |
| 1336 | 1336 |
| 1337 | 1337 |
| 1338 class Thread::PlatformData : public Malloced { | 1338 class Thread::PlatformData { |
| 1339 public: | 1339 public: |
| 1340 explicit PlatformData(HANDLE thread) : thread_(thread) {} | 1340 explicit PlatformData(HANDLE thread) : thread_(thread) {} |
| 1341 HANDLE thread_; | 1341 HANDLE thread_; |
| 1342 unsigned thread_id_; | 1342 unsigned thread_id_; |
| 1343 }; | 1343 }; |
| 1344 | 1344 |
| 1345 | 1345 |
| 1346 // Initialize a Win32 thread object. The thread has an invalid thread | 1346 // Initialize a Win32 thread object. The thread has an invalid thread |
| 1347 // handle until it is started. | 1347 // handle until it is started. |
| 1348 | 1348 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1414 ASSERT(result); | 1414 ASSERT(result); |
| 1415 } | 1415 } |
| 1416 | 1416 |
| 1417 | 1417 |
| 1418 | 1418 |
| 1419 void Thread::YieldCPU() { | 1419 void Thread::YieldCPU() { |
| 1420 Sleep(0); | 1420 Sleep(0); |
| 1421 } | 1421 } |
| 1422 | 1422 |
| 1423 } } // namespace v8::internal | 1423 } } // namespace v8::internal |
| OLD | NEW |