summaryrefslogtreecommitdiff
path: root/include/apr_pools.h
diff options
context:
space:
mode:
authorsf <sf@13f79535-47bb-0310-9956-ffa450edef68>2013-03-23 16:12:00 +0000
committersf <sf@13f79535-47bb-0310-9956-ffa450edef68>2013-03-23 16:12:00 +0000
commit714bda5580cec37ab38db2483d6e324749e9cf77 (patch)
treed7528c0c5b50c11450b4d7f9d57aa60043fa7365 /include/apr_pools.h
parent9ae1899baabe2c52094fd09cf70196f17d6107a3 (diff)
downloadlibapr-714bda5580cec37ab38db2483d6e324749e9cf77.tar.gz
Add apr_pool_owner_set function to allow use of pool debugging with threads
Actually this function has been mentioned in the docs for over 10 years but has never been implemented. Also consistently destroy the thread's pool when it exits normally, not only on apr_thread_exit(). This was already done on OS2. Other platforms than unix are untested. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@1460182 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include/apr_pools.h')
-rw-r--r--include/apr_pools.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/apr_pools.h b/include/apr_pools.h
index 755320e5c..6f50ade8f 100644
--- a/include/apr_pools.h
+++ b/include/apr_pools.h
@@ -741,6 +741,17 @@ APR_DECLARE(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub)
__attribute__((nonnull(2)));
/**
+ * Guarantee that a pool is only used by the current thread.
+ * This should be used when a pool is created by a different thread than
+ * the thread it is using, or if there is some locking in use to ensure
+ * that only one thread uses the pool at the same time.
+ *
+ * @param pool The pool
+ * @param flags Flags, currently unused
+ */
+APR_DECLARE(void) apr_pool_owner_set(apr_pool_t *pool, apr_uint32_t flags);
+
+/**
* Find a pool from something allocated in it.
* @param mem The thing allocated in the pool
* @return The pool it is allocated in
@@ -772,6 +783,11 @@ APR_DECLARE(void) apr_pool_lock(apr_pool_t *pool, int flag);
#endif
#define apr_pool_join(a,b)
+#ifdef apr_pool_owner_set
+#undef apr_pool_owner_set
+#endif
+#define apr_pool_owner_set(a,b)
+
#ifdef apr_pool_lock
#undef apr_pool_lock
#endif