aboutsummaryrefslogtreecommitdiff
path: root/lib/libkse
diff options
context:
space:
mode:
authorDaniel Eischen <deischen@FreeBSD.org>1999-12-28 18:13:04 +0000
committerDaniel Eischen <deischen@FreeBSD.org>1999-12-28 18:13:04 +0000
commit1752e66d49ea5d9653b0cec4df9949774de0b806 (patch)
treecfe4b336992c8189f28dd9dd04ab184768a47b5e /lib/libkse
parent69186ed701cbfc740d08df24d46b8d184b6f57eb (diff)
Notes
Diffstat (limited to 'lib/libkse')
-rw-r--r--lib/libkse/thread/thr_detach.c1
-rw-r--r--lib/libkse/thread/thr_fork.c18
-rw-r--r--lib/libkse/thread/thr_poll.c2
-rw-r--r--lib/libkse/thread/thr_priority_queue.c2
-rw-r--r--lib/libkse/thread/thr_setschedparam.c2
-rw-r--r--lib/libkse/thread/thr_spec.c2
6 files changed, 13 insertions, 14 deletions
diff --git a/lib/libkse/thread/thr_detach.c b/lib/libkse/thread/thr_detach.c
index 164c7dfe54e1..89cc6671179c 100644
--- a/lib/libkse/thread/thr_detach.c
+++ b/lib/libkse/thread/thr_detach.c
@@ -40,7 +40,6 @@ int
pthread_detach(pthread_t pthread)
{
int rval = 0;
- int status;
pthread_t next_thread;
/* Check for invalid calling parameters: */
diff --git a/lib/libkse/thread/thr_fork.c b/lib/libkse/thread/thr_fork.c
index b8d72dc00da2..08ea8129ea71 100644
--- a/lib/libkse/thread/thr_fork.c
+++ b/lib/libkse/thread/thr_fork.c
@@ -33,6 +33,7 @@
*/
#include <errno.h>
#include <string.h>
+#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#ifdef _THREAD_SAFE
@@ -130,29 +131,28 @@ fork(void)
pthread_save, tle);
if (pthread_save->attr.stackaddr_attr ==
- NULL && pthread_save->stack != NULL)
+ NULL && pthread_save->stack != NULL) {
if (pthread_save->attr.stacksize_attr
== PTHREAD_STACK_DEFAULT) {
/*
- * Default-size stack. Cache
- * it:
+ * Default-size stack.
+ * Cache it:
*/
struct stack *spare_stack;
spare_stack
= (pthread_save->stack
- + PTHREAD_STACK_DEFAULT
- - sizeof(struct stack));
- SLIST_INSERT_HEAD(
- &_stackq,
- spare_stack,
- qe);
+ + PTHREAD_STACK_DEFAULT
+ - sizeof(struct stack));
+ SLIST_INSERT_HEAD(&_stackq,
+ spare_stack, qe);
} else
/*
* Free the stack of
* the dead thread:
*/
free(pthread_save->stack);
+ }
if (pthread_save->specific_data != NULL)
free(pthread_save->specific_data);
diff --git a/lib/libkse/thread/thr_poll.c b/lib/libkse/thread/thr_poll.c
index 01916ad1b4e1..10a9db74e359 100644
--- a/lib/libkse/thread/thr_poll.c
+++ b/lib/libkse/thread/thr_poll.c
@@ -48,7 +48,7 @@ poll(struct pollfd *fds, unsigned int nfds, int timeout)
{
struct timespec ts;
int numfds = nfds;
- int i, ret = 0, found = 0;
+ int i, ret = 0;
struct pthread_poll_data data;
if (numfds > _thread_dtablesize) {
diff --git a/lib/libkse/thread/thr_priority_queue.c b/lib/libkse/thread/thr_priority_queue.c
index 5bd8a8cc2826..6fdf844ac8af 100644
--- a/lib/libkse/thread/thr_priority_queue.c
+++ b/lib/libkse/thread/thr_priority_queue.c
@@ -87,7 +87,7 @@ static int _pq_active = 0;
int
_pq_alloc(pq_queue_t *pq, int minprio, int maxprio)
{
- int i, ret = 0;
+ int ret = 0;
int prioslots = maxprio - minprio + 1;
if (pq == NULL)
diff --git a/lib/libkse/thread/thr_setschedparam.c b/lib/libkse/thread/thr_setschedparam.c
index 57e24e856421..f080d5ddba57 100644
--- a/lib/libkse/thread/thr_setschedparam.c
+++ b/lib/libkse/thread/thr_setschedparam.c
@@ -63,9 +63,9 @@ pthread_setschedparam(pthread_t pthread, int policy,
* queue before any adjustments are made to its
* active priority:
*/
+ old_prio = pthread->active_priority;
if ((pthread->flags & PTHREAD_FLAGS_IN_PRIOQ) != 0) {
in_readyq = 1;
- old_prio = pthread->active_priority;
PTHREAD_PRIOQ_REMOVE(pthread);
}
diff --git a/lib/libkse/thread/thr_spec.c b/lib/libkse/thread/thr_spec.c
index f1e9f5c08a9b..1485cbb7e9d9 100644
--- a/lib/libkse/thread/thr_spec.c
+++ b/lib/libkse/thread/thr_spec.c
@@ -88,7 +88,7 @@ pthread_key_delete(pthread_key_t key)
void
_thread_cleanupspecific(void)
{
- void *data;
+ void *data = NULL;
int key;
int itr;
void (*destructor)( void *);