diff options
author | bnicholes <bnicholes@13f79535-47bb-0310-9956-ffa450edef68> | 2001-10-05 16:57:40 +0000 |
---|---|---|
committer | bnicholes <bnicholes@13f79535-47bb-0310-9956-ffa450edef68> | 2001-10-05 16:57:40 +0000 |
commit | 86ca294440944262cca7413fe494bc1c2eeb370c (patch) | |
tree | 23ddf5d6dc820c49138054c5e5bed47fa9abb69c | |
parent | b2226b6f7b1afc3b3b1ed9c032b7db1b69ab763e (diff) | |
download | libapr-86ca294440944262cca7413fe494bc1c2eeb370c.tar.gz |
Fixed NetWare thread handling so that it can deal with multiple argument
thread functions
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@62401 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | threadproc/netware/thread.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/threadproc/netware/thread.c b/threadproc/netware/thread.c index d9b81c34a..c8d16529c 100644 --- a/threadproc/netware/thread.c +++ b/threadproc/netware/thread.c @@ -89,6 +89,12 @@ apr_status_t apr_threadattr_detach_get(apr_threadattr_t *attr) return APR_NOTDETACH; } +static void *dummy_worker(void *opaque) +{ + apr_thread_t *thd = (apr_thread_t *)opaque; + return thd->func(thd, thd->data); +} + apr_status_t apr_thread_create(apr_thread_t **new, apr_threadattr_t *attr, apr_thread_start_t func, @@ -123,6 +129,9 @@ apr_status_t apr_thread_create(apr_thread_t **new, } (*new)->cntxt = cont; + (*new)->data = data; + (*new)->func = func; + (*new)->thread_name = (char*)apr_pstrdup(cont, threadName); stat = apr_pool_create(&(*new)->cntxt, cont); if (stat != APR_SUCCESS) { @@ -134,8 +143,8 @@ apr_status_t apr_thread_create(apr_thread_t **new, } (*new)->ctx = NXContextAlloc( - /* void(*start_routine)(void *arg)*/(void (*)(void *)) func, - /* void *arg */ data, + /* void(*start_routine)(void *arg)*/(void (*)(void *)) dummy_worker, + /* void *arg */ (*new), /* int priority */ NX_PRIO_MED, /* NXSize_t stackSize */ stack_size, /* long flags */ NX_CTX_NORMAL, |