Chromium Code Reviews| Index: runtime/bin/eventhandler_win.cc |
| diff --git a/runtime/bin/eventhandler_win.cc b/runtime/bin/eventhandler_win.cc |
| index 043db3c7a1d714128913f883f54ea4780cb17cd2..6f0d241620fd696a1b8e8c02db1b3cdc55292da4 100644 |
| --- a/runtime/bin/eventhandler_win.cc |
| +++ b/runtime/bin/eventhandler_win.cc |
| @@ -1,14 +1,15 @@ |
| -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| +// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| // for details. All rights reserved. Use of this source code is governed by a |
| // BSD-style license that can be found in the LICENSE file. |
| +#include "bin/eventhandler.h" |
| + |
| #include <process.h> |
| #include <winsock2.h> |
| #include <ws2tcpip.h> |
| #include <mswsock.h> |
| #include "bin/builtin.h" |
| -#include "bin/eventhandler.h" |
| #include "bin/socket.h" |
| @@ -823,7 +824,7 @@ void EventHandlerImplementation::SendData(intptr_t id, |
| } |
| -static unsigned int __stdcall EventHandlerThread(void* args) { |
| +static void EventHandlerThread(uword args) { |
| EventHandlerImplementation* handler = |
| reinterpret_cast<EventHandlerImplementation*>(args); |
|
siva
2012/01/27 18:53:17
ASSERT(handler != NULL);
Søren Gjesse
2012/01/30 14:42:57
Done.
|
| while (true) { |
| @@ -877,11 +878,10 @@ static unsigned int __stdcall EventHandlerThread(void* args) { |
| void EventHandlerImplementation::StartEventHandler() { |
| - uint32_t tid; |
| - uintptr_t thread_handle = |
| - _beginthreadex(NULL, 32 * 1024, EventHandlerThread, this, 0, &tid); |
| - if (thread_handle == -1) { |
| - FATAL("Failed to start event handler thread"); |
| + int result = dart::Thread::Start(EventHandlerThread, |
| + reinterpret_cast<uword>(this)); |
| + if (result != 0) { |
| + FATAL1("Failed to start event handler thread %d", result); |
| } |
| // Initialize Winsock32 |