Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Side by Side Diff: mojo/edk/system/data_pipe_producer_dispatcher.cc

Issue 2259363002: Mojo EDK: Add tests to exercise races in handle transit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | mojo/edk/system/data_pipe_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mojo/edk/system/data_pipe_producer_dispatcher.h" 5 #include "mojo/edk/system/data_pipe_producer_dispatcher.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <utility> 10 #include <utility>
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 new DataPipeProducerDispatcher(node_controller, port, ring_buffer, 396 new DataPipeProducerDispatcher(node_controller, port, ring_buffer,
397 state->options, false /* initialized */, 397 state->options, false /* initialized */,
398 state->pipe_id); 398 state->pipe_id);
399 399
400 { 400 {
401 base::AutoLock lock(dispatcher->lock_); 401 base::AutoLock lock(dispatcher->lock_);
402 dispatcher->write_offset_ = state->write_offset; 402 dispatcher->write_offset_ = state->write_offset;
403 dispatcher->available_capacity_ = state->available_capacity; 403 dispatcher->available_capacity_ = state->available_capacity;
404 dispatcher->peer_closed_ = state->flags & kFlagPeerClosed; 404 dispatcher->peer_closed_ = state->flags & kFlagPeerClosed;
405 dispatcher->InitializeNoLock(); 405 dispatcher->InitializeNoLock();
406 dispatcher->UpdateSignalsStateNoLock();
406 } 407 }
407 408
408 return dispatcher; 409 return dispatcher;
409 } 410 }
410 411
411 DataPipeProducerDispatcher::~DataPipeProducerDispatcher() { 412 DataPipeProducerDispatcher::~DataPipeProducerDispatcher() {
412 DCHECK(is_closed_ && !in_transit_ && !shared_ring_buffer_ && 413 DCHECK(is_closed_ && !in_transit_ && !shared_ring_buffer_ &&
413 !ring_buffer_mapping_); 414 !ring_buffer_mapping_);
414 } 415 }
415 416
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 } 541 }
541 542
542 if (peer_closed_ != was_peer_closed || 543 if (peer_closed_ != was_peer_closed ||
543 available_capacity_ != previous_capacity) { 544 available_capacity_ != previous_capacity) {
544 awakable_list_.AwakeForStateChange(GetHandleSignalsStateNoLock()); 545 awakable_list_.AwakeForStateChange(GetHandleSignalsStateNoLock());
545 } 546 }
546 } 547 }
547 548
548 } // namespace edk 549 } // namespace edk
549 } // namespace mojo 550 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | mojo/edk/system/data_pipe_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698