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

Side by Side Diff: pkg/barback/lib/src/utils/pool.dart

Issue 261823008: Reorganize barback's source files. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: re-add barback/lib/src/internal_asset.dart Created 6 years, 7 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 | « pkg/barback/lib/src/utils/multiset.dart ('k') | pkg/barback/lib/src/utils/stream_pool.dart » ('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 (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 library barback.pool; 5 library barback.utils.pool;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'package:stack_trace/stack_trace.dart'; 10 import 'package:stack_trace/stack_trace.dart';
11 11
12 import 'utils.dart'; 12 import '../utils.dart';
13 13
14 // TODO(nweiz): put this somewhere that it can be shared between packages. 14 // TODO(nweiz): put this somewhere that it can be shared between packages.
15 /// Manages an abstract pool of resources with a limit on how many may be in use 15 /// Manages an abstract pool of resources with a limit on how many may be in use
16 /// at once. 16 /// at once.
17 /// 17 ///
18 /// When a resource is needed, the user should call [request]. When the returned 18 /// When a resource is needed, the user should call [request]. When the returned
19 /// future completes with a [PoolResource], the resource may be allocated. Once 19 /// future completes with a [PoolResource], the resource may be allocated. Once
20 /// the resource has been released, the user should call [PoolResource.release]. 20 /// the resource has been released, the user should call [PoolResource.release].
21 /// The pool will ensure that only a certain number of [PoolResource]s may be 21 /// The pool will ensure that only a certain number of [PoolResource]s may be
22 /// allocated at once. 22 /// allocated at once.
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 /// Tells the parent [Pool] that the resource associated with this resource is 132 /// Tells the parent [Pool] that the resource associated with this resource is
133 /// no longer allocated, and that a new [PoolResource] may be allocated. 133 /// no longer allocated, and that a new [PoolResource] may be allocated.
134 void release() { 134 void release() {
135 if (_released) { 135 if (_released) {
136 throw new StateError("A PoolResource may only be released once."); 136 throw new StateError("A PoolResource may only be released once.");
137 } 137 }
138 _released = true; 138 _released = true;
139 _pool._onResourceReleased(); 139 _pool._onResourceReleased();
140 } 140 }
141 } 141 }
OLDNEW
« no previous file with comments | « pkg/barback/lib/src/utils/multiset.dart ('k') | pkg/barback/lib/src/utils/stream_pool.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698