summaryrefslogtreecommitdiff
path: root/threadproc/unix/thread.c
diff options
context:
space:
mode:
authortrawick <trawick@13f79535-47bb-0310-9956-ffa450edef68>2000-05-16 17:48:57 +0000
committertrawick <trawick@13f79535-47bb-0310-9956-ffa450edef68>2000-05-16 17:48:57 +0000
commit7bbce05d2ecb45e915b61ef1ce4d66f7da573b2f (patch)
tree7d1e709ef74679c065f40be322d4136621f5b56e /threadproc/unix/thread.c
parent5da35d9a90f3352feb5432a1e2dcaf82029215da (diff)
downloadlibapr-7bbce05d2ecb45e915b61ef1ce4d66f7da573b2f.tar.gz
Handle some OS/390-isms dealing with pthreads:
. the types of the parameters to pthread_attr_setdetachstate() and pthread_detach() . the fact that sigprocmask() must be use to set a thread's signal mask git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@60047 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'threadproc/unix/thread.c')
-rw-r--r--threadproc/unix/thread.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/threadproc/unix/thread.c b/threadproc/unix/thread.c
index 7ba240d4b..ca2cdff96 100644
--- a/threadproc/unix/thread.c
+++ b/threadproc/unix/thread.c
@@ -81,7 +81,13 @@ ap_status_t ap_create_threadattr(ap_threadattr_t **new, ap_pool_t *cont)
ap_status_t ap_setthreadattr_detach(ap_threadattr_t *attr, ap_int32_t on)
{
ap_status_t stat;
+#ifdef PTHREAD_ATTR_SETDETACHSTATE_ARG2_ADDR
+ int arg = on;
+
+ if ((stat = pthread_attr_setdetachstate(attr->attr, &arg)) == 0) {
+#else
if ((stat = pthread_attr_setdetachstate(attr->attr, on)) == 0) {
+#endif
return APR_SUCCESS;
}
else {
@@ -165,7 +171,11 @@ ap_status_t ap_thread_detach(ap_thread_t *thd)
{
ap_status_t stat;
+#ifdef PTHREAD_DETACH_ARG1_ADDR
+ if ((stat = pthread_detach(thd->td)) == 0) {
+#else
if ((stat = pthread_detach(*thd->td)) == 0) {
+#endif
return APR_SUCCESS;
}
else {