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

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

Issue 175223004: Revert "Add lock to a file handle in windows event handler." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 | « no previous file | no next file » | 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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 } 226 }
227 227
228 228
229 static void ReadFileThread(uword args) { 229 static void ReadFileThread(uword args) {
230 Handle* handle = reinterpret_cast<Handle*>(args); 230 Handle* handle = reinterpret_cast<Handle*>(args);
231 handle->ReadSyncCompleteAsync(); 231 handle->ReadSyncCompleteAsync();
232 } 232 }
233 233
234 234
235 void Handle::ReadSyncCompleteAsync() { 235 void Handle::ReadSyncCompleteAsync() {
236 ScopedLock lock(this);
237 ASSERT(pending_read_ != NULL); 236 ASSERT(pending_read_ != NULL);
238 ASSERT(pending_read_->GetBufferSize() >= kStdOverlappedBufferSize); 237 ASSERT(pending_read_->GetBufferSize() >= kStdOverlappedBufferSize);
239 238
240 DWORD buffer_size = pending_read_->GetBufferSize(); 239 DWORD buffer_size = pending_read_->GetBufferSize();
241 if (GetFileType(handle_) == FILE_TYPE_CHAR) { 240 if (GetFileType(handle_) == FILE_TYPE_CHAR) {
242 buffer_size = kStdOverlappedBufferSize; 241 buffer_size = kStdOverlappedBufferSize;
243 } 242 }
244 DWORD bytes_read = 0; 243 DWORD bytes_read = 0;
245 BOOL ok = ReadFile(handle_, 244 BOOL ok = ReadFile(handle_,
246 pending_read_->GetBufferStart(), 245 pending_read_->GetBufferStart(),
(...skipping 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after
1300 1299
1301 1300
1302 void EventHandlerImplementation::Shutdown() { 1301 void EventHandlerImplementation::Shutdown() {
1303 Notify(kShutdownId, 0, 0); 1302 Notify(kShutdownId, 0, 0);
1304 } 1303 }
1305 1304
1306 } // namespace bin 1305 } // namespace bin
1307 } // namespace dart 1306 } // namespace dart
1308 1307
1309 #endif // defined(TARGET_OS_WINDOWS) 1308 #endif // defined(TARGET_OS_WINDOWS)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698