diff options
-rw-r--r-- | src/include/rados/librados.hpp | 7 | ||||
-rw-r--r-- | src/librados/PoolAsyncCompletionImpl.h | 5 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/include/rados/librados.hpp b/src/include/rados/librados.hpp index 3f6d025ff41..c8de9f9df33 100644 --- a/src/include/rados/librados.hpp +++ b/src/include/rados/librados.hpp @@ -789,7 +789,12 @@ namespace librados int cluster_stat(cluster_stat_t& result); int cluster_fsid(std::string *fsid); - /* pool aio */ + /* + * pool aio + * + * It is up to the caller to release the completion handler, even if the pool_create_async() + * and/or pool_delete_async() fails and does not send the async request + */ static PoolAsyncCompletion *pool_async_create_completion(); // -- aio -- diff --git a/src/librados/PoolAsyncCompletionImpl.h b/src/librados/PoolAsyncCompletionImpl.h index efb89641466..443b2c23a17 100644 --- a/src/librados/PoolAsyncCompletionImpl.h +++ b/src/librados/PoolAsyncCompletionImpl.h @@ -94,6 +94,9 @@ namespace librados { C_PoolAsync_Safe(PoolAsyncCompletionImpl *_c) : c(_c) { c->get(); } + ~C_PoolAsync_Safe() { + c->put(); + } void finish(int r) { c->lock.Lock(); @@ -109,7 +112,7 @@ namespace librados { c->lock.Lock(); } - c->put_unlock(); + c->lock.Unlock(); } }; } |