summaryrefslogtreecommitdiff
path: root/attr.c
diff options
context:
space:
mode:
authorrpj <rpj>1998-07-26 14:49:34 +0000
committerrpj <rpj>1998-07-26 14:49:34 +0000
commit537fe68bc5ca2dd75f4f54146a50a39c5b55b8e3 (patch)
tree25adc4da03898e307d43f8dcc3450b3b5260c867 /attr.c
parent779359d2cf050c2885a05b81774b87b82466a471 (diff)
Mon Jul 27 00:20:37 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* private.c (_pthread_delete_thread_entry): Destroy the thread entry attribute object before deleting the thread entry itself. * attr.c (pthread_attr_init): Initialise cancel_pending = FALSE. (pthread_attr_setdetachstate): Rename "detached" to "detachedstate". (pthread_attr_getdetachstate): Ditto. * exit.c (_pthread_exit): Fix incorrect check for detachedstate. * implement.h (_pthread_call_t): Remove env member.
Diffstat (limited to 'attr.c')
-rw-r--r--attr.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/attr.c b/attr.c
index 65c00a0..03c254b 100644
--- a/attr.c
+++ b/attr.c
@@ -100,13 +100,14 @@ pthread_attr_init(pthread_attr_t *attr)
attr->cancelstate = PTHREAD_CANCEL_ENABLE;
attr->canceltype = PTHREAD_CANCEL_DEFERRED;
+ attr->cancel_pending = FALSE;
attr->detachedstate = PTHREAD_CREATE_JOINABLE;
memset(&(attr->sigmask), 0, sizeof(sigset_t));
/* Priority uses Win32 priority values. */
int priority = THREAD_PRIORITY_NORMAL;
- attr->valid = 0;
+ attr->valid = _PTHREAD_ATTR_VALID;
return 0;
}
@@ -120,7 +121,7 @@ pthread_attr_destroy(pthread_attr_t *attr)
}
/* Set the attribute object to a specific invalid value. */
- attr->valid = _PTHREAD_ATTR_INVALID;
+ attr->valid = 0;
return 0;
}
@@ -134,7 +135,7 @@ pthread_attr_getdetachstate(const pthread_attr_t *attr,
return EINVAL;
}
- *detachstate = attr->detached;
+ *detachstate = attr->detachedstate;
return 0;
}
@@ -153,6 +154,6 @@ pthread_attr_setdetachstate(pthread_attr_t *attr,
return EINVAL;
}
- attr->detached = detachstate;
+ attr->detachedstate = detachstate;
return 0;
}