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

Side by Side Diff: mojo/edk/system/wait_set_dispatcher.cc

Issue 2061913002: Don't call the other wait set impl dispatcher methods under mutex either. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « mojo/edk/system/wait_set_dispatcher.h ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "mojo/edk/system/wait_set_dispatcher.h" 5 #include "mojo/edk/system/wait_set_dispatcher.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "mojo/edk/system/options_validation.h" 8 #include "mojo/edk/system/options_validation.h"
9 9
10 using mojo::util::MutexLocker; 10 using mojo::util::MutexLocker;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 65
66 RefPtr<Dispatcher> 66 RefPtr<Dispatcher>
67 WaitSetDispatcher::CreateEquivalentDispatcherAndCloseImplNoLock( 67 WaitSetDispatcher::CreateEquivalentDispatcherAndCloseImplNoLock(
68 MessagePipe* /*message_pipe*/, 68 MessagePipe* /*message_pipe*/,
69 unsigned /*port*/) { 69 unsigned /*port*/) {
70 mutex().AssertHeld(); 70 mutex().AssertHeld();
71 NOTREACHED(); 71 NOTREACHED();
72 return nullptr; 72 return nullptr;
73 } 73 }
74 74
75 MojoResult WaitSetDispatcher::WaitSetAddImplNoLock( 75 MojoResult WaitSetDispatcher::WaitSetAddImpl(
76 UserPointer<const MojoWaitSetAddOptions> options, 76 UserPointer<const MojoWaitSetAddOptions> options,
77 Handle&& handle, 77 Handle&& handle,
78 MojoHandleSignals signals, 78 MojoHandleSignals signals,
79 uint64_t cookie) { 79 uint64_t cookie) {
80 mutex().AssertHeld(); 80 MutexLocker locker(&mutex());
81 if (is_closed_no_lock())
82 return MOJO_RESULT_INVALID_ARGUMENT;
81 83
82 // TODO(vtl) 84 // TODO(vtl)
83 NOTIMPLEMENTED(); 85 NOTIMPLEMENTED();
84 return MOJO_RESULT_UNIMPLEMENTED; 86 return MOJO_RESULT_UNIMPLEMENTED;
85 } 87 }
86 88
87 MojoResult WaitSetDispatcher::WaitSetRemoveImplNoLock(uint64_t cookie) { 89 MojoResult WaitSetDispatcher::WaitSetRemoveImpl(uint64_t cookie) {
88 mutex().AssertHeld(); 90 MutexLocker locker(&mutex());
91 if (is_closed_no_lock())
92 return MOJO_RESULT_INVALID_ARGUMENT;
89 93
90 // TODO(vtl) 94 // TODO(vtl)
91 NOTIMPLEMENTED(); 95 NOTIMPLEMENTED();
92 return MOJO_RESULT_UNIMPLEMENTED; 96 return MOJO_RESULT_UNIMPLEMENTED;
93 } 97 }
94 98
95 MojoResult WaitSetDispatcher::WaitSetWaitImpl( 99 MojoResult WaitSetDispatcher::WaitSetWaitImpl(
96 MojoDeadline deadline, 100 MojoDeadline deadline,
97 UserPointer<uint32_t> num_results, 101 UserPointer<uint32_t> num_results,
98 UserPointer<MojoWaitSetResult> results, 102 UserPointer<MojoWaitSetResult> results,
99 UserPointer<uint32_t> max_results) { 103 UserPointer<uint32_t> max_results) {
100 MutexLocker locker(&mutex()); 104 MutexLocker locker(&mutex());
101 if (is_closed_no_lock()) 105 if (is_closed_no_lock())
102 return MOJO_RESULT_INVALID_ARGUMENT; 106 return MOJO_RESULT_INVALID_ARGUMENT;
103 107
104 // TODO(vtl) 108 // TODO(vtl)
105 NOTIMPLEMENTED(); 109 NOTIMPLEMENTED();
106 return MOJO_RESULT_UNIMPLEMENTED; 110 return MOJO_RESULT_UNIMPLEMENTED;
107 } 111 }
108 112
109 } // namespace system 113 } // namespace system
110 } // namespace mojo 114 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/wait_set_dispatcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698