OLD | NEW |
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.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'; |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 | 131 |
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 } |
OLD | NEW |