diff --git a/cpp/array_record_writer.cc b/cpp/array_record_writer.cc index ef722af..1edd276 100644 --- a/cpp/array_record_writer.cc +++ b/cpp/array_record_writer.cc @@ -250,7 +250,7 @@ class ArrayRecordWriterBase::SubmitChunkCallback // return false if we can't schedule the callback. // return true and inc num_concurrent_chunk_writers if we can add a new one. bool TrackConcurrentChunkWriters() { - absl::MutexLock l(&mu_); + absl::MutexLock l(mu_); if (num_concurrent_chunk_writers_ >= max_parallelism_) { return false; } @@ -495,7 +495,7 @@ void ArrayRecordWriterBase::SubmitChunkCallback::operator()( footer.set_num_records(num_records); array_footer_.push_back(std::move(footer)); - absl::MutexLock l(&mu_); + absl::MutexLock l(mu_); num_concurrent_chunk_writers_--; } diff --git a/cpp/sequenced_chunk_writer.cc b/cpp/sequenced_chunk_writer.cc index 23b15f1..6a25bc4 100644 --- a/cpp/sequenced_chunk_writer.cc +++ b/cpp/sequenced_chunk_writer.cc @@ -34,7 +34,7 @@ namespace array_record { bool SequencedChunkWriterBase::CommitFutureChunk( std::future>&& future_chunk) { - absl::MutexLock l(&mu_); + absl::MutexLock l(mu_); if (!ok()) { return false; } @@ -64,13 +64,13 @@ bool SequencedChunkWriterBase::SubmitFutureChunks(bool block) { if (block) { // When blocking, we block both on mutex acquisition and on future // completion. - absl::MutexLock lock(&mu_); + absl::MutexLock lock(mu_); riegeli::ChunkWriter* writer = get_writer(); while (!queue_.empty()) { TrySubmitFirstFutureChunk(writer); } return ok(); - } else if (mu_.TryLock()) { + } else if (mu_.try_lock()) { // When non-blocking, we only proceed if we can lock the mutex without // blocking, and we only process those futures that are ready. We need // to unlock the mutex manually in this case, and take care to call ok() @@ -82,7 +82,7 @@ bool SequencedChunkWriterBase::SubmitFutureChunks(bool block) { TrySubmitFirstFutureChunk(writer); } bool result = ok(); - mu_.Unlock(); + mu_.unlock(); return result; } else { return true;