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

Side by Side Diff: sdk/lib/collection/queue.dart

Issue 27308003: Document that concurrent modification is bad, m'kay. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | sdk/lib/core/iterable.dart » ('j') | sdk/lib/core/iterable.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart.collection; 5 part of dart.collection;
6 6
7 /** 7 /**
8 * A [Queue] is a collection that can be manipulated at both ends. One 8 * A [Queue] is a collection that can be manipulated at both ends. One
9 * can iterate over the elements of a queue through [forEach] or with 9 * can iterate over the elements of a queue through [forEach] or with
10 * an [Iterator]. 10 * an [Iterator].
11 *
12 * It is generally not allowed to modify the queue (add or remove entries) while
13 * an operation on the queue is being performed, for example during a call to
14 * [forEach].
15 * Modifying the queue while it is being iterated will most likely break the
16 * iteration.
17 * This goes both for using the [iteator] directly, or for iterating an
floitsch 2013/10/15 15:32:24 iterator
Lasse Reichstein Nielsen 2013/10/16 05:41:24 Done.
18 * `Iterable` returned by a method like [map] or [where].
11 */ 19 */
12 abstract class Queue<E> implements Iterable<E>, EfficientLength { 20 abstract class Queue<E> implements Iterable<E>, EfficientLength {
13 21
14 /** 22 /**
15 * Creates a queue. 23 * Creates a queue.
16 */ 24 */
17 factory Queue() = ListQueue<E>; 25 factory Queue() = ListQueue<E>;
18 26
19 /** 27 /**
20 * Creates a queue with the elements of [other]. The order in 28 * Creates a queue with the elements of [other]. The order in
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
690 _queue._checkModification(_modificationCount); 698 _queue._checkModification(_modificationCount);
691 if (_position == _end) { 699 if (_position == _end) {
692 _current = null; 700 _current = null;
693 return false; 701 return false;
694 } 702 }
695 _current = _queue._table[_position]; 703 _current = _queue._table[_position];
696 _position = (_position + 1) & (_queue._table.length - 1); 704 _position = (_position + 1) & (_queue._table.length - 1);
697 return true; 705 return true;
698 } 706 }
699 } 707 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/core/iterable.dart » ('j') | sdk/lib/core/iterable.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698