summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbje <bje>1998-10-06 01:22:45 +0000
committerbje <bje>1998-10-06 01:22:45 +0000
commit498a7979aa94b4cf8c93c5e0634a527a234a2839 (patch)
tree7b02342ab5ee195ee33e88fdce1a75304d276ba3
parent2363e35bd8151df977e1451f741c2fe48e64304c (diff)
Move comment to a more obvious position.
-rw-r--r--cancel.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/cancel.c b/cancel.c
index 28d2cbc..9dd99c6 100644
--- a/cancel.c
+++ b/cancel.c
@@ -38,8 +38,8 @@ pthread_setcanceltype(int type, int *oldtype)
pthread_t us = pthread_self();
/* Validate the new cancellation type. */
- if (type != PTHREAD_CANCEL_DEFERRED
- || type != PTHREAD_CANCEL_ASYNCHRONOUS)
+ if (type == PTHREAD_CANCEL_ASYNCHRONOUS ||
+ type != PTHREAD_CANCEL_DEFERRED)
{
return EINVAL;
}
@@ -69,9 +69,7 @@ pthread_cancel(pthread_t thread)
void
pthread_testcancel(void)
{
- pthread_t thread;
-
- thread = pthread_self();
+ pthread_t thread = pthread_self();
if (thread->cancelstate == PTHREAD_CANCEL_DISABLE)
{
@@ -81,7 +79,6 @@ pthread_testcancel(void)
if (thread->cancel_pending == TRUE)
{
pthread_exit(PTHREAD_CANCELED);
-
- /* Never reached. */
}
+ /* Never reached. */
}