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

Unified 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: Cannot be misread as iterating changing the length. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sdk/lib/core/iterable.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/collection/queue.dart
diff --git a/sdk/lib/collection/queue.dart b/sdk/lib/collection/queue.dart
index 4e2c5aa4200bd2e60ab56c7b1b51c57d33aa455c..f94fb130f6641be934946ed8f99df11a1c7a5ba8 100644
--- a/sdk/lib/collection/queue.dart
+++ b/sdk/lib/collection/queue.dart
@@ -8,6 +8,14 @@ part of dart.collection;
* A [Queue] is a collection that can be manipulated at both ends. One
* can iterate over the elements of a queue through [forEach] or with
* an [Iterator].
+ *
+ * It is generally not allowed to modify the queue (add or remove entries) while
+ * an operation on the queue is being performed, for example during a call to
+ * [forEach].
+ * Modifying the queue while it is being iterated will most likely break the
+ * iteration.
+ * This goes both for using the [iterator] directly, or for iterating an
+ * `Iterable` returned by a method like [map] or [where].
*/
abstract class Queue<E> implements Iterable<E>, EfficientLength {
« no previous file with comments | « no previous file | sdk/lib/core/iterable.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698