summaryrefslogtreecommitdiff
path: root/pthread_mutexattr_settype.c
diff options
context:
space:
mode:
authorrpj <rpj>2004-05-17 01:38:02 +0000
committerrpj <rpj>2004-05-17 01:38:02 +0000
commit771465fed0cf50ee2dd790723245fc091699c324 (patch)
treed8c18d095a33fe7c4564bd90c5f313bb9e4057dd /pthread_mutexattr_settype.c
parent8b14911744f58cbe3730703f3fcc41cd969fd0f3 (diff)
re-indentation, bug fixes, hooks for pre-emptive async cancelation
Diffstat (limited to 'pthread_mutexattr_settype.c')
-rw-r--r--pthread_mutexattr_settype.c79
1 files changed, 39 insertions, 40 deletions
diff --git a/pthread_mutexattr_settype.c b/pthread_mutexattr_settype.c
index 1ebecec..942a199 100644
--- a/pthread_mutexattr_settype.c
+++ b/pthread_mutexattr_settype.c
@@ -39,8 +39,7 @@
int
-pthread_mutexattr_settype (pthread_mutexattr_t * attr,
- int kind)
+pthread_mutexattr_settype (pthread_mutexattr_t * attr, int kind)
/*
* ------------------------------------------------------
*
@@ -52,18 +51,18 @@ pthread_mutexattr_settype (pthread_mutexattr_t * attr,
*
* PARAMETERS
* attr
- * pointer to an instance of pthread_mutexattr_t
+ * pointer to an instance of pthread_mutexattr_t
*
* type
- * must be one of:
+ * must be one of:
*
- * PTHREAD_MUTEX_DEFAULT
+ * PTHREAD_MUTEX_DEFAULT
*
- * PTHREAD_MUTEX_NORMAL
+ * PTHREAD_MUTEX_NORMAL
*
- * PTHREAD_MUTEX_ERRORCHECK
+ * PTHREAD_MUTEX_ERRORCHECK
*
- * PTHREAD_MUTEX_RECURSIVE
+ * PTHREAD_MUTEX_RECURSIVE
*
* DESCRIPTION
* The pthread_mutexattr_settype() and
@@ -76,45 +75,45 @@ pthread_mutexattr_settype (pthread_mutexattr_t * attr,
* mutex attributes. Valid mutex types include:
*
* PTHREAD_MUTEX_NORMAL
- * This type of mutex does not detect deadlock. A
- * thread attempting to relock this mutex without
- * first unlocking it will deadlock. Attempting to
- * unlock a mutex locked by a different thread
- * results in undefined behavior. Attempting to
- * unlock an unlocked mutex results in undefined
- * behavior.
+ * This type of mutex does not detect deadlock. A
+ * thread attempting to relock this mutex without
+ * first unlocking it will deadlock. Attempting to
+ * unlock a mutex locked by a different thread
+ * results in undefined behavior. Attempting to
+ * unlock an unlocked mutex results in undefined
+ * behavior.
*
* PTHREAD_MUTEX_ERRORCHECK
- * This type of mutex provides error checking. A
- * thread attempting to relock this mutex without
- * first unlocking it will return with an error. A
- * thread attempting to unlock a mutex which another
- * thread has locked will return with an error. A
- * thread attempting to unlock an unlocked mutex will
- * return with an error.
+ * This type of mutex provides error checking. A
+ * thread attempting to relock this mutex without
+ * first unlocking it will return with an error. A
+ * thread attempting to unlock a mutex which another
+ * thread has locked will return with an error. A
+ * thread attempting to unlock an unlocked mutex will
+ * return with an error.
*
* PTHREAD_MUTEX_DEFAULT
- * Same as PTHREAD_MUTEX_NORMAL.
+ * Same as PTHREAD_MUTEX_NORMAL.
*
* PTHREAD_MUTEX_RECURSIVE
- * A thread attempting to relock this mutex without
- * first unlocking it will succeed in locking the
- * mutex. The relocking deadlock which can occur with
- * mutexes of type PTHREAD_MUTEX_NORMAL cannot occur
- * with this type of mutex. Multiple locks of this
- * mutex require the same number of unlocks to
- * release the mutex before another thread can
- * acquire the mutex. A thread attempting to unlock a
- * mutex which another thread has locked will return
- * with an error. A thread attempting to unlock an
- * unlocked mutex will return with an error. This
- * type of mutex is only supported for mutexes whose
- * process shared attribute is
- * PTHREAD_PROCESS_PRIVATE.
+ * A thread attempting to relock this mutex without
+ * first unlocking it will succeed in locking the
+ * mutex. The relocking deadlock which can occur with
+ * mutexes of type PTHREAD_MUTEX_NORMAL cannot occur
+ * with this type of mutex. Multiple locks of this
+ * mutex require the same number of unlocks to
+ * release the mutex before another thread can
+ * acquire the mutex. A thread attempting to unlock a
+ * mutex which another thread has locked will return
+ * with an error. A thread attempting to unlock an
+ * unlocked mutex will return with an error. This
+ * type of mutex is only supported for mutexes whose
+ * process shared attribute is
+ * PTHREAD_PROCESS_PRIVATE.
*
* RESULTS
- * 0 successfully set attribute,
- * EINVAL 'attr' or 'type' is invalid,
+ * 0 successfully set attribute,
+ * EINVAL 'attr' or 'type' is invalid,
*
* ------------------------------------------------------
*/
@@ -139,6 +138,6 @@ pthread_mutexattr_settype (pthread_mutexattr_t * attr,
{
result = EINVAL;
}
-
+
return (result);
} /* pthread_mutexattr_settype */