diff options
author | jorton <jorton@13f79535-47bb-0310-9956-ffa450edef68> | 2004-06-10 10:57:25 +0000 |
---|---|---|
committer | jorton <jorton@13f79535-47bb-0310-9956-ffa450edef68> | 2004-06-10 10:57:25 +0000 |
commit | d4cf4787c0a8860253d80f2512534668da2e33ae (patch) | |
tree | 8bf765683e1d69f6bc72c583d35bf610770de3ee /include/apr_thread_proc.h | |
parent | 9c7d2d584d516b8447f7844ca490f248c2d6f965 (diff) | |
download | libapr-d4cf4787c0a8860253d80f2512534668da2e33ae.tar.gz |
Add apr_threadattr_guardsize_set function, which allows changing
the thread guard area size attribute for newly created threads.
* configure.in: Check for pthread_attr_setguardsize.
* include/apr_thread_proc.h (apr_threadattr_guardsize_set): Add
prototype.
* threadproc/unix/thread.c (apr_threadattr_guardsize_set): Add
function.
* threadproc/os2/thread.c, threadproc/win32/thread.c,
threadproc/beos/thread.c, threadproc/netware/thread.c
(apr_threadattr_guardsize_set): Add ENOTIMPL stubs.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@65179 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include/apr_thread_proc.h')
-rw-r--r-- | include/apr_thread_proc.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/apr_thread_proc.h b/include/apr_thread_proc.h index bd783bf90..ab7b2fed3 100644 --- a/include/apr_thread_proc.h +++ b/include/apr_thread_proc.h @@ -224,6 +224,19 @@ APR_DECLARE(apr_status_t) apr_threadattr_stacksize_set(apr_threadattr_t *attr, apr_size_t stacksize); /** + * Set the stack guard area size of newly created threads. + * @param attr The threadattr to affect + * @param guardsize The stack guard area size in bytes + * @note Thread library implementations commonly use a "guard area" + * after each thread's stack which is not readable or writable such that + * stack overflows cause a segfault; this consumes e.g. 4K of memory + * and increases memory management overhead. Setting the guard area + * size to zero hence trades off reliable behaviour on stack overflow + * for performance. */ +APR_DECLARE(apr_status_t) apr_threadattr_guardsize_set(apr_threadattr_t *attr, + apr_size_t guardsize); + +/** * Create a new thread of execution * @param new_thread The newly created thread handle. * @param attr The threadattr to use to determine how to create the thread |