summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2022-01-25 20:14:55 +0000
committerYann Ylavic <ylavic@apache.org>2022-01-25 20:14:55 +0000
commit865e0f3805b4f46d77a43bc661fd793dbaaa7ff6 (patch)
tree33c018b578c888228c8b6ed79741c439a25370ed /include
parent05023098b8283a21bf1c5229db6c6c73c6407a0e (diff)
downloadapr-865e0f3805b4f46d77a43bc661fd793dbaaa7ff6.tar.gz
apr_thread: Follow up to r1897207: Provide apr_thread_current_after_fork().
thread_local variables are not (always?) reset on fork(), so APR (and the user) needs a way to set the current_thread to NULL. Use apr_thread_current_after_fork() in apr_proc_fork()'s child process. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1897470 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include')
-rw-r--r--include/apr_thread_proc.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h
index 270cb24b2..85f697dd2 100644
--- a/include/apr_thread_proc.h
+++ b/include/apr_thread_proc.h
@@ -289,7 +289,7 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new_thread,
void *data, apr_pool_t *cont);
/**
- * Setup the current os_thread as an apr_thread
+ * Setup the current native thread as an apr_thread
* @param current The current apr_thread set up (or reused)
* @param attr The threadattr associated with the current thread
* @param pool The parent pool of the current thread
@@ -299,6 +299,12 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new_thread,
APR_DECLARE(apr_status_t) apr_thread_current_create(apr_thread_t **current,
apr_threadattr_t *attr,
apr_pool_t *pool);
+
+/**
+ * Clear the current thread after fork()
+ */
+APR_DECLARE(void) apr_thread_current_after_fork(void);
+
/**
* Get the current thread
* @param The current apr_thread, NULL if it is not an apr_thread or if