summaryrefslogtreecommitdiff
path: root/threadproc/win32/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'threadproc/win32/thread.c')
-rw-r--r--threadproc/win32/thread.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/threadproc/win32/thread.c b/threadproc/win32/thread.c
index da36c3d83..92b6755a6 100644
--- a/threadproc/win32/thread.c
+++ b/threadproc/win32/thread.c
@@ -38,6 +38,9 @@ APR_DECLARE(apr_status_t) apr_threadattr_create(apr_threadattr_t **new,
}
(*new)->pool = pool;
+ (*new)->detach = 0;
+ (*new)->stacksize = 0;
+
return APR_SUCCESS;
}
@@ -55,6 +58,13 @@ APR_DECLARE(apr_status_t) apr_threadattr_detach_get(apr_threadattr_t *attr)
return APR_NOTDETACH;
}
+APR_DECLARE(apr_status_t) apr_threadattr_stacksize_set(apr_threadattr_t *attr,
+ apr_size_t stacksize)
+{
+ attr->stacksize = stacksize;
+ return APR_SUCCESS;
+}
+
static void *dummy_worker(void *opaque)
{
apr_thread_t *thd = (apr_thread_t *)opaque;
@@ -89,13 +99,15 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new,
* same size as the calling thread.
*/
#ifndef _WIN32_WCE
- if (((*new)->td = (HANDLE)_beginthreadex(NULL, 0,
+ if (((*new)->td = (HANDLE)_beginthreadex(NULL,
+ attr && attr->stacksize > 0 ? attr->stacksize : 0,
(unsigned int (APR_THREAD_FUNC *)(void *))dummy_worker,
(*new), 0, &temp)) == 0) {
return APR_FROM_OS_ERROR(_doserrno);
}
#else
- if (((*new)->td = CreateThread(NULL, 0,
+ if (((*new)->td = CreateThread(NULL,
+ attr && attr->stacksize > 0 ? attr->stacksize : 0,
(unsigned int (APR_THREAD_FUNC *)(void *))dummy_worker,
(*new), 0, &temp)) == 0) {
return apr_get_os_error();