Commit 07ab2e2b authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook GitHub Bot

migrate from LockedPtr::getUniqueLock

Summary: The new name is `LockedPtr::as_lock`.

Reviewed By: aary

Differential Revision: D28987868

fbshipit-source-id: 8abd6a69a1b9c884adf137f06c24fe0df9ddd089
parent 78e483e0
...@@ -117,7 +117,7 @@ void AsyncLogWriter::flush() { ...@@ -117,7 +117,7 @@ void AsyncLogWriter::flush() {
messageReady_.notify_one(); messageReady_.notify_one();
// Wait for notification from the I/O thread that it has done work. // Wait for notification from the I/O thread that it has done work.
ioCV_.wait(data.getUniqueLock()); ioCV_.wait(data.as_lock());
} }
} }
...@@ -145,7 +145,7 @@ void AsyncLogWriter::ioThread() { ...@@ -145,7 +145,7 @@ void AsyncLogWriter::ioThread() {
ioQueue = data->getCurrentQueue(); ioQueue = data->getCurrentQueue();
while (ioQueue->empty() && !(data->flags & FLAG_STOP)) { while (ioQueue->empty() && !(data->flags & FLAG_STOP)) {
// Wait for a message or one of the above flags to be set. // Wait for a message or one of the above flags to be set.
messageReady_.wait(data.getUniqueLock()); messageReady_.wait(data.as_lock());
} }
if (data->flags & FLAG_STOP) { if (data->flags & FLAG_STOP) {
...@@ -219,7 +219,7 @@ void AsyncLogWriter::stopIoThread( ...@@ -219,7 +219,7 @@ void AsyncLogWriter::stopIoThread(
uint32_t extraFlags) { uint32_t extraFlags) {
data->flags |= (FLAG_STOP | extraFlags); data->flags |= (FLAG_STOP | extraFlags);
messageReady_.notify_one(); messageReady_.notify_one();
ioCV_.wait(data.getUniqueLock(), [&] { ioCV_.wait(data.as_lock(), [&] {
return bool(data->flags & FLAG_IO_THREAD_STOPPED); return bool(data->flags & FLAG_IO_THREAD_STOPPED);
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment