Index: third_party/mojo/src/mojo/edk/system/core.cc |
diff --git a/third_party/mojo/src/mojo/edk/system/core.cc b/third_party/mojo/src/mojo/edk/system/core.cc |
index fbb6cf1fbf9e7c0f204a34f468e6aa3987719dfd..35d6614a084c787681fe3b03c4a8db1c9e243504 100644 |
--- a/third_party/mojo/src/mojo/edk/system/core.cc |
+++ b/third_party/mojo/src/mojo/edk/system/core.cc |
@@ -86,7 +86,7 @@ |
} |
MojoHandle Core::AddDispatcher(const scoped_refptr<Dispatcher>& dispatcher) { |
- MutexLocker locker(&handle_table_mutex_); |
+ base::AutoLock locker(handle_table_lock_); |
return handle_table_.AddDispatcher(dispatcher); |
} |
@@ -94,7 +94,7 @@ |
if (handle == MOJO_HANDLE_INVALID) |
return nullptr; |
- MutexLocker locker(&handle_table_mutex_); |
+ base::AutoLock locker(handle_table_lock_); |
return handle_table_.GetDispatcher(handle); |
} |
@@ -103,7 +103,7 @@ |
if (handle == MOJO_HANDLE_INVALID) |
return MOJO_RESULT_INVALID_ARGUMENT; |
- MutexLocker locker(&handle_table_mutex_); |
+ base::AutoLock locker(handle_table_lock_); |
return handle_table_.GetAndRemoveDispatcher(handle, dispatcher); |
} |
@@ -130,7 +130,7 @@ |
scoped_refptr<Dispatcher> dispatcher; |
{ |
- MutexLocker locker(&handle_table_mutex_); |
+ base::AutoLock locker(handle_table_lock_); |
MojoResult result = |
handle_table_.GetAndRemoveDispatcher(handle, &dispatcher); |
if (result != MOJO_RESULT_OK) |
@@ -138,7 +138,7 @@ |
} |
// The dispatcher doesn't have a say in being closed, but gets notified of it. |
- // Note: This is done outside of |handle_table_mutex_|. As a result, there's a |
+ // Note: This is done outside of |handle_table_lock_|. As a result, there's a |
// race condition that the dispatcher must handle; see the comment in |
// |Dispatcher| in dispatcher.h. |
return dispatcher->Close(); |
@@ -211,7 +211,7 @@ |
std::pair<MojoHandle, MojoHandle> handle_pair; |
{ |
- MutexLocker locker(&handle_table_mutex_); |
+ base::AutoLock locker(handle_table_lock_); |
handle_pair = handle_table_.AddDispatcherPair(dispatcher0, dispatcher1); |
} |
if (handle_pair.first == MOJO_HANDLE_INVALID) { |
@@ -276,7 +276,7 @@ |
// and mark the handles as busy. If the call succeeds, we then remove the |
// handles from the handle table. |
{ |
- MutexLocker locker(&handle_table_mutex_); |
+ base::AutoLock locker(handle_table_lock_); |
MojoResult result = handle_table_.MarkBusyAndStartTransport( |
message_pipe_handle, handles_reader.GetPointer(), num_handles, |
&transports); |
@@ -293,7 +293,7 @@ |
transports[i].End(); |
{ |
- MutexLocker locker(&handle_table_mutex_); |
+ base::AutoLock locker(handle_table_lock_); |
if (rv == MOJO_RESULT_OK) { |
handle_table_.RemoveBusyHandles(handles_reader.GetPointer(), num_handles); |
} else { |
@@ -335,7 +335,7 @@ |
UserPointer<MojoHandle>::Writer handles_writer(handles, |
dispatchers.size()); |
{ |
- MutexLocker locker(&handle_table_mutex_); |
+ base::AutoLock locker(handle_table_lock_); |
success = handle_table_.AddDispatcherVector( |
dispatchers, handles_writer.GetPointer()); |
} |
@@ -377,7 +377,7 @@ |
std::pair<MojoHandle, MojoHandle> handle_pair; |
{ |
- MutexLocker locker(&handle_table_mutex_); |
+ base::AutoLock locker(handle_table_lock_); |
handle_pair = handle_table_.AddDispatcherPair(producer_dispatcher, |
consumer_dispatcher); |
} |
@@ -539,7 +539,7 @@ |
DCHECK(mapping); |
void* address = mapping->GetBase(); |
{ |
- MutexLocker locker(&mapping_table_mutex_); |
+ base::AutoLock locker(mapping_table_lock_); |
result = mapping_table_.AddMapping(mapping.Pass()); |
} |
if (result != MOJO_RESULT_OK) |
@@ -550,7 +550,7 @@ |
} |
MojoResult Core::UnmapBuffer(UserPointer<void> buffer) { |
- MutexLocker locker(&mapping_table_mutex_); |
+ base::AutoLock locker(mapping_table_lock_); |
return mapping_table_.RemoveMapping(buffer.GetPointerValue()); |
} |