summaryrefslogtreecommitdiff
path: root/attr.c
diff options
context:
space:
mode:
Diffstat (limited to 'attr.c')
-rw-r--r--attr.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/attr.c b/attr.c
index 0e72575..22332c0 100644
--- a/attr.c
+++ b/attr.c
@@ -11,7 +11,7 @@
static int
is_attr(pthread_attr_t *attr)
{
- /* Return 0 if the attr object is valid, 1 otherwise. */
+ /* Return 0 if the attr object is valid, non-zero otherwise. */
return (attr == NULL || attr->valid != _PTHREAD_ATTR_VALID);
}
@@ -107,6 +107,20 @@ pthread_attr_init(pthread_attr_t *attr)
}
int
+pthread_attr_destroy(pthread_attr_t *attr)
+{
+ if (is_attr(attr) != 0)
+ {
+ return EINVAL;
+ }
+
+ /* Set the attribute object to a specific invalid value. */
+ attr->valid = _PTHREAD_ATTR_INVALID;
+
+ return 0;
+}
+
+int
pthread_attr_getdetachstate(const pthread_attr_t *attr,
int *detachstate)
{
@@ -137,17 +151,3 @@ pthread_attr_setdetachstate(pthread_attr_t *attr,
attr->detached = detachstate;
return 0;
}
-
-int
-pthread_attr_destroy(pthread_attr_t *attr)
-{
- if (is_attr(attr) != 0)
- {
- return EINVAL;
- }
-
- /* Set the attribute object to a specific invalid value. */
- attr->valid = _PTHREAD_ATTR_INVALID;
-
- return 0;
-}