AWS SDK for C++AWS SDK for C++ Version 1.11.791 |
#include <ResourceManager.h>
Generic resource manager with Acquire/Release semantics. Acquire will block waiting on a an available resource. Release will cause one blocked acquisition to unblock.
You must call ShutdownAndWait() when finished with this container, this unblocks the listening thread and gives you a chance to clean up the resource if needed. After calling ShutdownAndWait(), you must not call Acquire any more.
Definition at line 26 of file ResourceManager.h.
Definition at line 29 of file ResourceManager.h.
Returns a resource with exclusive ownership. You must call Release on the resource when you are finished or other threads will block waiting to acquire it.
Definition at line 37 of file ResourceManager.h.
Returns whether or not resources are currently available for acquisition
Definition at line 111 of file ResourceManager.h.
Does not block or even touch the semaphores. This is intended for setup only, do not use this after Acquire has been called for the first time.
| resource | resource to be managed. |
Definition at line 135 of file ResourceManager.h.
Releases a resource back to the pool. This will unblock one waiting Acquire call if any are waiting.
| resource | resource to release back to the pool |
Definition at line 122 of file ResourceManager.h.
Waits for all acquired resources to be released, then empties the queue. You must call ShutdownAndWait() when finished with this container, this unblocks the listening thread and gives you a chance to clean up the resource if needed. After calling ShutdownAndWait(), you must not call Acquire any more.
@params resourceCount the number of resources you've added to the resource manager.
Definition at line 149 of file ResourceManager.h.
Returns a resource with exclusive ownership or a nullptr. If resource is available within the wait timeout then the resource is returned. otherwise (if the timeout has expired or container is shutdown) the nullptr is returned. You must call Release on the resource when you are finished. This method is enabled only for pointer RESOURCE_TYPE type.
Definition at line 87 of file ResourceManager.h.
0)
Returns a resource with exclusive ownership. You must call Release on the resource when you are finished or other threads will block waiting to acquire it.
Definition at line 59 of file ResourceManager.h.