diff options
author | trawick <trawick@13f79535-47bb-0310-9956-ffa450edef68> | 2004-03-01 21:05:44 +0000 |
---|---|---|
committer | trawick <trawick@13f79535-47bb-0310-9956-ffa450edef68> | 2004-03-01 21:05:44 +0000 |
commit | 9d4b4e287b5f900bfb93dce204e97622bd134e0a (patch) | |
tree | 23fa8dede3931a898817011373a794896a233723 /threadproc/win32 | |
parent | 718fb3706ea0a81c32d400a99df63397ac54198e (diff) | |
download | libapr-9d4b4e287b5f900bfb93dce204e97622bd134e0a.tar.gz |
Add apr_threadattr_stacksize_set() for overriding the default
stack size for threads created by apr_thread_create().
This is currently a not-implemented stub for BeOS.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64934 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'threadproc/win32')
-rw-r--r-- | threadproc/win32/thread.c | 16 |
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(); |