diff options
Diffstat (limited to 'OpenSim/Framework/Pool.cs')
-rw-r--r-- | OpenSim/Framework/Pool.cs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/OpenSim/Framework/Pool.cs b/OpenSim/Framework/Pool.cs index 1ca06c3..5484f5c 100644 --- a/OpenSim/Framework/Pool.cs +++ b/OpenSim/Framework/Pool.cs | |||
@@ -38,8 +38,23 @@ namespace OpenSim.Framework | |||
38 | /// </remarks> | 38 | /// </remarks> |
39 | public class Pool<T> | 39 | public class Pool<T> |
40 | { | 40 | { |
41 | /// <summary> | ||
42 | /// Number of objects in the pool. | ||
43 | /// </summary> | ||
44 | public int Count | ||
45 | { | ||
46 | get | ||
47 | { | ||
48 | lock (m_pool) | ||
49 | return m_pool.Count; | ||
50 | } | ||
51 | } | ||
52 | |||
41 | private Stack<T> m_pool; | 53 | private Stack<T> m_pool; |
42 | 54 | ||
55 | /// <summary> | ||
56 | /// Maximum pool size. Beyond this, any returned objects are not pooled. | ||
57 | /// </summary> | ||
43 | private int m_maxPoolSize; | 58 | private int m_maxPoolSize; |
44 | 59 | ||
45 | private Func<T> m_createFunction; | 60 | private Func<T> m_createFunction; |