| Index: runtime/bin/socket_win.cc
|
| diff --git a/runtime/bin/socket_win.cc b/runtime/bin/socket_win.cc
|
| index 77c51ef92bc6648ce4f53e2e5c077b8465ae28c3..da82b273b68ec6385beeb2252cec366a395d6706 100644
|
| --- a/runtime/bin/socket_win.cc
|
| +++ b/runtime/bin/socket_win.cc
|
| @@ -12,6 +12,8 @@
|
| #include "bin/socket.h"
|
| #include "bin/utils.h"
|
|
|
| +#include "vm/thread.h"
|
| +
|
|
|
| namespace dart {
|
| namespace bin {
|
| @@ -217,11 +219,15 @@ intptr_t ServerSocket::Accept(intptr_t fd) {
|
| }
|
|
|
|
|
| +static Mutex* getaddrinfo_mutex = new Mutex();
|
| AddressList<SocketAddress>* Socket::LookupAddress(const char* host,
|
| int type,
|
| OSError** os_error) {
|
| Initialize();
|
|
|
| + // getaddrinfo is not thread-safe on Windows. Use a mutex to get around it.
|
| + MutexLocker locker(getaddrinfo_mutex);
|
| +
|
| // Perform a name lookup for a host name.
|
| struct addrinfo hints;
|
| memset(&hints, 0, sizeof(hints));
|
|
|