Space Engineers
Public Member Functions | List of all members
ParallelTasks.Pool< T > Class Template Reference

A thread safe, non-blocking, object pool. More...

Inheritance diagram for ParallelTasks.Pool< T >:

Public Member Functions

 Pool ()
 Initializes a new instance of the Pool&lt;T&gt; class. More...
 
Get (Thread thread)
 Gets an instance from the pool. More...
 
void Return (Thread thread, T instance)
 Returns an instance to the pool, so it is available for re-use. It is advised that the item is reset to a default state before being returned. More...
 
void Clean ()
 

Detailed Description

A thread safe, non-blocking, object pool.

Template Parameters
TThe type of item to store. Must be a class with a parameterless constructor.
Type Constraints
T :class 
T :new() 

Definition at line 16 of file Pool.cs.

Constructor & Destructor Documentation

ParallelTasks.Pool< T >.Pool ( )
inline

Initializes a new instance of the Pool&lt;T&gt; class.

Definition at line 25 of file Pool.cs.

Member Function Documentation

void ParallelTasks.Pool< T >.Clean ( )
inline

Definition at line 70 of file Pool.cs.

T ParallelTasks.Pool< T >.Get ( Thread  thread)
inline

Gets an instance from the pool.

Returns
An instance of T .

Definition at line 38 of file Pool.cs.

void ParallelTasks.Pool< T >.Return ( Thread  thread,
instance 
)
inline

Returns an instance to the pool, so it is available for re-use. It is advised that the item is reset to a default state before being returned.

Parameters
instanceThe instance to return to the pool.

Definition at line 62 of file Pool.cs.


The documentation for this class was generated from the following file: