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

Side by Side Diff: base/waitable_event_win.cc

Issue 360034: Add 64bit support. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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 | « base/string_util.cc ('k') | 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium 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 #include "base/waitable_event.h" 5 #include "base/waitable_event.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <windows.h> 8 #include <windows.h>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 75
76 // static 76 // static
77 size_t WaitableEvent::WaitMany(WaitableEvent** events, size_t count) { 77 size_t WaitableEvent::WaitMany(WaitableEvent** events, size_t count) {
78 HANDLE handles[MAXIMUM_WAIT_OBJECTS]; 78 HANDLE handles[MAXIMUM_WAIT_OBJECTS];
79 CHECK(count <= MAXIMUM_WAIT_OBJECTS) 79 CHECK(count <= MAXIMUM_WAIT_OBJECTS)
80 << "Can only wait on " << MAXIMUM_WAIT_OBJECTS << " with WaitMany"; 80 << "Can only wait on " << MAXIMUM_WAIT_OBJECTS << " with WaitMany";
81 81
82 for (size_t i = 0; i < count; ++i) 82 for (size_t i = 0; i < count; ++i)
83 handles[i] = events[i]->handle(); 83 handles[i] = events[i]->handle();
84 84
85 // The cast is safe because count is small - see the CHECK above.
85 DWORD result = 86 DWORD result =
86 WaitForMultipleObjects(count, handles, 87 WaitForMultipleObjects(static_cast<DWORD>(count),
88 handles,
87 FALSE, // don't wait for all the objects 89 FALSE, // don't wait for all the objects
88 INFINITE); // no timeout 90 INFINITE); // no timeout
89 if (result >= WAIT_OBJECT_0 + count) { 91 if (result >= WAIT_OBJECT_0 + count) {
90 NOTREACHED() << "WaitForMultipleObjects failed: " << GetLastError(); 92 NOTREACHED() << "WaitForMultipleObjects failed: " << GetLastError();
91 return 0; 93 return 0;
92 } 94 }
93 95
94 return result - WAIT_OBJECT_0; 96 return result - WAIT_OBJECT_0;
95 } 97 }
96 98
97 } // namespace base 99 } // namespace base
OLDNEW
« no previous file with comments | « base/string_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698