Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Side by Side Diff: runtime/bin/eventhandler_win.cc

Issue 154273003: Make std* blocking file-descriptors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update with bug. Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/bin/eventhandler_macos.cc ('k') | runtime/bin/file_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 "platform/globals.h" 5 #include "platform/globals.h"
6 #if defined(TARGET_OS_WINDOWS) 6 #if defined(TARGET_OS_WINDOWS)
7 7
8 #include "bin/eventhandler.h" 8 #include "bin/eventhandler.h"
9 9
10 #include <winsock2.h> // NOLINT 10 #include <winsock2.h> // NOLINT
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 708
709 void StdHandle::DoClose() { 709 void StdHandle::DoClose() {
710 MonitorLocker locker(write_monitor_); 710 MonitorLocker locker(write_monitor_);
711 if (write_thread_exists_) { 711 if (write_thread_exists_) {
712 write_thread_running_ = false; 712 write_thread_running_ = false;
713 locker.Notify(); 713 locker.Notify();
714 while (write_thread_exists_) { 714 while (write_thread_exists_) {
715 locker.Wait(Monitor::kNoTimeout); 715 locker.Wait(Monitor::kNoTimeout);
716 } 716 }
717 } 717 }
718 if (handle_ == GetStdHandle(STD_OUTPUT_HANDLE)) { 718 Handle::DoClose();
719 int fd = _open("NUL", _O_WRONLY);
720 ASSERT(fd >= 0);
721 _dup2(fd, _fileno(stdout));
722 close(fd);
723 } else {
724 Handle::DoClose();
725 }
726 } 719 }
727 720
728 721
729 bool ClientSocket::LoadDisconnectEx() { 722 bool ClientSocket::LoadDisconnectEx() {
730 // Load the DisconnectEx function into memory using WSAIoctl. 723 // Load the DisconnectEx function into memory using WSAIoctl.
731 GUID guid_disconnect_ex = WSAID_DISCONNECTEX; 724 GUID guid_disconnect_ex = WSAID_DISCONNECTEX;
732 DWORD bytes; 725 DWORD bytes;
733 int status = WSAIoctl(socket(), 726 int status = WSAIoctl(socket(),
734 SIO_GET_EXTENSION_FUNCTION_POINTER, 727 SIO_GET_EXTENSION_FUNCTION_POINTER,
735 &guid_disconnect_ex, 728 &guid_disconnect_ex,
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
1309 1302
1310 1303
1311 void EventHandlerImplementation::Shutdown() { 1304 void EventHandlerImplementation::Shutdown() {
1312 SendData(kShutdownId, 0, 0); 1305 SendData(kShutdownId, 0, 0);
1313 } 1306 }
1314 1307
1315 } // namespace bin 1308 } // namespace bin
1316 } // namespace dart 1309 } // namespace dart
1317 1310
1318 #endif // defined(TARGET_OS_WINDOWS) 1311 #endif // defined(TARGET_OS_WINDOWS)
OLDNEW
« no previous file with comments | « runtime/bin/eventhandler_macos.cc ('k') | runtime/bin/file_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698