summaryrefslogtreecommitdiff
path: root/threadproc
diff options
context:
space:
mode:
authorjorton <jorton@13f79535-47bb-0310-9956-ffa450edef68>2004-06-10 10:57:25 +0000
committerjorton <jorton@13f79535-47bb-0310-9956-ffa450edef68>2004-06-10 10:57:25 +0000
commitd4cf4787c0a8860253d80f2512534668da2e33ae (patch)
tree8bf765683e1d69f6bc72c583d35bf610770de3ee /threadproc
parent9c7d2d584d516b8447f7844ca490f248c2d6f965 (diff)
downloadlibapr-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 'threadproc')
-rw-r--r--threadproc/beos/thread.c6
-rw-r--r--threadproc/netware/thread.c6
-rw-r--r--threadproc/os2/thread.c6
-rw-r--r--threadproc/unix/thread.c19
-rw-r--r--threadproc/win32/thread.c6
5 files changed, 43 insertions, 0 deletions
diff --git a/threadproc/beos/thread.c b/threadproc/beos/thread.c
index 15f1ca091..7c63bf7af 100644
--- a/threadproc/beos/thread.c
+++ b/threadproc/beos/thread.c
@@ -55,6 +55,12 @@ APR_DECLARE(apr_status_t) apr_threadattr_stacksize_set(apr_threadattr_t *attr,
return APR_ENOTIMPL;
}
+APR_DECLARE(apr_status_t) apr_threadattr_guardsize_set(apr_threadattr_t *attr,
+ apr_size_t size)
+{
+ return APR_ENOTIMPL;
+}
+
static void *dummy_worker(void *opaque)
{
apr_thread_t *thd = (apr_thread_t*)opaque;
diff --git a/threadproc/netware/thread.c b/threadproc/netware/thread.c
index 1703b55b1..466d99115 100644
--- a/threadproc/netware/thread.c
+++ b/threadproc/netware/thread.c
@@ -57,6 +57,12 @@ APR_DECLARE(apr_status_t) apr_threadattr_stacksize_set(apr_threadattr_t *attr,
return APR_SUCCESS;
}
+APR_DECLARE(apr_status_t) apr_threadattr_guardsize_set(apr_threadattr_t *attr,
+ apr_size_t size)
+{
+ return APR_ENOTIMPL;
+}
+
static void *dummy_worker(void *opaque)
{
apr_thread_t *thd = (apr_thread_t *)opaque;
diff --git a/threadproc/os2/thread.c b/threadproc/os2/thread.c
index 24b29f680..582ad78a2 100644
--- a/threadproc/os2/thread.c
+++ b/threadproc/os2/thread.c
@@ -59,6 +59,12 @@ APR_DECLARE(apr_status_t) apr_threadattr_stacksize_set(apr_threadattr_t *attr,
return APR_SUCCESS;
}
+APR_DECLARE(apr_status_t) apr_threadattr_guardsize_set(apr_threadattr_t *attr,
+ apr_size_t size)
+{
+ return APR_ENOTIMPL;
+}
+
static void apr_thread_begin(void *arg)
{
apr_thread_t *thread = (apr_thread_t *)arg;
diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c
index 00eee7ea3..d906e0954 100644
--- a/threadproc/unix/thread.c
+++ b/threadproc/unix/thread.c
@@ -94,6 +94,25 @@ APR_DECLARE(apr_status_t) apr_threadattr_stacksize_set(apr_threadattr_t *attr,
return stat;
}
+APR_DECLARE(apr_status_t) apr_threadattr_guardsize_set(apr_threadattr_t *attr,
+ apr_size_t size)
+{
+#ifdef HAVE_PTHREAD_ATTR_SETGUARDSIZE
+ apr_status_t rv;
+
+ rv = pthread_attr_setguardsize(&attr->attr, size);
+ if (rv == 0) {
+ return APR_SUCCESS;
+ }
+#ifdef PTHREAD_SETS_ERRNO
+ rv = errno;
+#endif
+ return rv;
+#else
+ return APR_ENOTIMPL;
+#endif
+}
+
static void *dummy_worker(void *opaque)
{
apr_thread_t *thread = (apr_thread_t*)opaque;
diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c
index 92b6755a6..364d23274 100644
--- a/threadproc/win32/thread.c
+++ b/threadproc/win32/thread.c
@@ -65,6 +65,12 @@ APR_DECLARE(apr_status_t) apr_threadattr_stacksize_set(apr_threadattr_t *attr,
return APR_SUCCESS;
}
+APR_DECLARE(apr_status_t) apr_threadattr_guardsize_set(apr_threadattr_t *attr,
+ apr_size_t size)
+{
+ return APR_ENOTIMPL;
+}
+
static void *dummy_worker(void *opaque)
{
apr_thread_t *thd = (apr_thread_t *)opaque;