Skip to content

Commit d614ea4

Browse files
drymancopybara-github
authored andcommitted
No public description
PiperOrigin-RevId: 819878701
1 parent bfa8b73 commit d614ea4

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

cpp/array_record_writer.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ class ArrayRecordWriterBase::SubmitChunkCallback
250250
// return false if we can't schedule the callback.
251251
// return true and inc num_concurrent_chunk_writers if we can add a new one.
252252
bool TrackConcurrentChunkWriters() {
253-
absl::MutexLock l(mu_);
253+
absl::MutexLock l(&mu_);
254254
if (num_concurrent_chunk_writers_ >= max_parallelism_) {
255255
return false;
256256
}
@@ -495,7 +495,7 @@ void ArrayRecordWriterBase::SubmitChunkCallback::operator()(
495495
footer.set_num_records(num_records);
496496
array_footer_.push_back(std::move(footer));
497497

498-
absl::MutexLock l(mu_);
498+
absl::MutexLock l(&mu_);
499499
num_concurrent_chunk_writers_--;
500500
}
501501

cpp/sequenced_chunk_writer.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ namespace array_record {
3434

3535
bool SequencedChunkWriterBase::CommitFutureChunk(
3636
std::future<absl::StatusOr<riegeli::Chunk>>&& future_chunk) {
37-
absl::MutexLock l(mu_);
37+
absl::MutexLock l(&mu_);
3838
if (!ok()) {
3939
return false;
4040
}
@@ -64,13 +64,13 @@ bool SequencedChunkWriterBase::SubmitFutureChunks(bool block) {
6464
if (block) {
6565
// When blocking, we block both on mutex acquisition and on future
6666
// completion.
67-
absl::MutexLock lock(mu_);
67+
absl::MutexLock lock(&mu_);
6868
riegeli::ChunkWriter* writer = get_writer();
6969
while (!queue_.empty()) {
7070
TrySubmitFirstFutureChunk(writer);
7171
}
7272
return ok();
73-
} else if (mu_.try_lock()) {
73+
} else if (mu_.TryLock()) {
7474
// When non-blocking, we only proceed if we can lock the mutex without
7575
// blocking, and we only process those futures that are ready. We need
7676
// to unlock the mutex manually in this case, and take care to call ok()
@@ -82,7 +82,7 @@ bool SequencedChunkWriterBase::SubmitFutureChunks(bool block) {
8282
TrySubmitFirstFutureChunk(writer);
8383
}
8484
bool result = ok();
85-
mu_.unlock();
85+
mu_.Unlock();
8686
return result;
8787
} else {
8888
return true;

0 commit comments

Comments
 (0)