@@ -51,7 +51,6 @@ void ObjectDescriptorImpl::Start(
5151 google::storage::v2::BidiReadObjectResponse first_response) {
5252 std::unique_lock<std::mutex> lk (mu_);
5353 auto it = stream_manager_->GetLastStream ();
54- // Unlock and start the Read loop first.
5554 lk.unlock ();
5655 OnRead (it, std::move (first_response));
5756 // Acquire lock and queue the background stream.
@@ -87,7 +86,7 @@ void ObjectDescriptorImpl::MakeSubsequentStream() {
8786 [](StreamManager::Stream const & s) {
8887 auto const * rs = s.stream .get ();
8988 return rs != nullptr && s.active_ranges .empty () &&
90- !rs->write_pending ;
89+ !rs->write_pending_ ;
9190 })) {
9291 return ;
9392 }
@@ -153,7 +152,7 @@ ObjectDescriptorImpl::Read(ReadParams p) {
153152 auto it = stream_manager_->GetLeastBusyStream ();
154153 auto const id = ++read_id_generator_;
155154 it->active_ranges .emplace (id, range);
156- auto & read_range = *it->stream ->next_request .add_read_ranges ();
155+ auto & read_range = *it->stream ->next_request_ .add_read_ranges ();
157156 read_range.set_read_id (id);
158157 read_range.set_read_offset (p.start );
159158 read_range.set_read_length (p.length );
@@ -169,13 +168,13 @@ ObjectDescriptorImpl::Read(ReadParams p) {
169168
170169void ObjectDescriptorImpl::Flush (std::unique_lock<std::mutex> lk,
171170 StreamIterator it) {
172- if (it->stream ->write_pending ||
173- it->stream ->next_request .read_ranges ().empty ()) {
171+ if (it->stream ->write_pending_ ||
172+ it->stream ->next_request_ .read_ranges ().empty ()) {
174173 return ;
175174 }
176- it->stream ->write_pending = true ;
175+ it->stream ->write_pending_ = true ;
177176 google::storage::v2::BidiReadObjectRequest request;
178- request.Swap (&it->stream ->next_request );
177+ request.Swap (&it->stream ->next_request_ );
179178
180179 // Assign CurrentStream to a temporary variable to prevent
181180 // lifetime extension which can cause the lock to be held until the
@@ -191,14 +190,14 @@ void ObjectDescriptorImpl::Flush(std::unique_lock<std::mutex> lk,
191190void ObjectDescriptorImpl::OnWrite (StreamIterator it, bool ok) {
192191 std::unique_lock<std::mutex> lk (mu_);
193192 if (!ok) return DoFinish (std::move (lk), it);
194- it->stream ->write_pending = false ;
193+ it->stream ->write_pending_ = false ;
195194 Flush (std::move (lk), it);
196195}
197196
198197void ObjectDescriptorImpl::DoRead (std::unique_lock<std::mutex> lk,
199198 StreamIterator it) {
200- if (it->stream ->read_pending ) return ;
201- it->stream ->read_pending = true ;
199+ if (it->stream ->read_pending_ ) return ;
200+ it->stream ->read_pending_ = true ;
202201
203202 // Assign CurrentStream to a temporary variable to prevent
204203 // lifetime extension which can cause the lock to be held until the
@@ -214,7 +213,7 @@ void ObjectDescriptorImpl::OnRead(
214213 StreamIterator it,
215214 absl::optional<google::storage::v2::BidiReadObjectResponse> response) {
216215 std::unique_lock<std::mutex> lk (mu_);
217- it->stream ->read_pending = false ;
216+ it->stream ->read_pending_ = false ;
218217
219218 if (!response) return DoFinish (std::move (lk), it);
220219 if (response->has_metadata ()) {
@@ -243,7 +242,7 @@ void ObjectDescriptorImpl::OnRead(
243242
244243void ObjectDescriptorImpl::DoFinish (std::unique_lock<std::mutex> lk,
245244 StreamIterator it) {
246- it->stream ->read_pending = false ;
245+ it->stream ->read_pending_ = false ;
247246 // Assign CurrentStream to a temporary variable to prevent
248247 // lifetime extension which can cause the lock to be held until the
249248 // end of the block.
@@ -293,8 +292,8 @@ void ObjectDescriptorImpl::OnResume(StreamIterator it,
293292
294293 it->stream = std::make_shared<ReadStream>(std::move (result->stream ),
295294 resume_policy_prototype_->clone ());
296- it->stream ->write_pending = false ;
297- it->stream ->read_pending = false ;
295+ it->stream ->write_pending_ = false ;
296+ it->stream ->read_pending_ = false ;
298297
299298 // TODO(#15105) - this should be done without release the lock.
300299 Flush (std::move (lk), it);
0 commit comments