summaryrefslogtreecommitdiffstats
path: root/lib/libpthread
diff options
context:
space:
mode:
authordeischen <deischen@FreeBSD.org>2001-04-10 04:22:24 +0000
committerdeischen <deischen@FreeBSD.org>2001-04-10 04:22:24 +0000
commitec98854211025e0207e45f7a5e6ea75cdad0177d (patch)
treeb4d9b7106f080bd00190e7d405be23471bf84cbe /lib/libpthread
parentdd46d4e05f2e301b4d9451bbfabfabbc788975c5 (diff)
downloadFreeBSD-src-ec98854211025e0207e45f7a5e6ea75cdad0177d.zip
FreeBSD-src-ec98854211025e0207e45f7a5e6ea75cdad0177d.tar.gz
Added a missing set of braces to a conditional that encompasses more than
one statement.
Diffstat (limited to 'lib/libpthread')
-rw-r--r--lib/libpthread/thread/thr_gc.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/libpthread/thread/thr_gc.c b/lib/libpthread/thread/thr_gc.c
index cdc9681..83ff38f 100644
--- a/lib/libpthread/thread/thr_gc.c
+++ b/lib/libpthread/thread/thr_gc.c
@@ -97,6 +97,10 @@ _thread_gc(pthread_addr_t arg)
*/
_thread_kern_sig_undefer();
+ /* No stack of thread structure to free yet: */
+ p_stack = NULL;
+ pthread_cln = NULL;
+
/*
* Lock the garbage collector mutex which ensures that
* this thread sees another thread exit:
@@ -104,10 +108,6 @@ _thread_gc(pthread_addr_t arg)
if (pthread_mutex_lock(&_gc_mutex) != 0)
PANIC("Cannot lock gc mutex");
- /* No stack of thread structure to free yet: */
- p_stack = NULL;
- pthread_cln = NULL;
-
/*
* Enter a loop to search for the first dead thread that
* has memory to free.
@@ -242,7 +242,7 @@ _thread_gc(pthread_addr_t arg)
*/
if (p_stack != NULL)
free(p_stack);
- if (pthread_cln != NULL)
+ if (pthread_cln != NULL) {
if (pthread_cln->name != NULL) {
/* Free the thread name string. */
free(pthread_cln->name);
@@ -252,6 +252,7 @@ _thread_gc(pthread_addr_t arg)
* structure.
*/
free(pthread_cln);
+ }
}
return (NULL);
}
OpenPOWER on IntegriCloud