diff options
author | Robert James Kaes <rjkaes@users.sourceforge.net> | 2001-09-07 18:19:39 +0000 |
---|---|---|
committer | Robert James Kaes <rjkaes@users.sourceforge.net> | 2001-09-07 18:19:39 +0000 |
commit | 28d955a3c81ff821dfb7206dbc599749092e1457 (patch) | |
tree | 8283a73b530c4a82ae3f6a263ebe04d3fad72b29 /src/thread.c | |
parent | 2b781f537cc10aa0e117199f405b85e73ee63eb7 (diff) | |
download | tinyproxy-28d955a3c81ff821dfb7206dbc599749092e1457.tar.gz tinyproxy-28d955a3c81ff821dfb7206dbc599749092e1457.zip |
Explictly added the DETACHED creation method on threads.
Diffstat (limited to '')
-rw-r--r-- | src/thread.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/thread.c b/src/thread.c index 67a54ae..f03a8a5 100644 --- a/src/thread.c +++ b/src/thread.c @@ -1,4 +1,4 @@ -/* $Id: thread.c,v 1.11 2001-09-07 04:19:05 rjkaes Exp $ +/* $Id: thread.c,v 1.12 2001-09-07 18:19:39 rjkaes Exp $ * * Handles the creation/destruction of the various threads required for * processing incoming connections. @@ -175,9 +175,12 @@ short int thread_pool_create(void) /* * Initialize thread_attr to contain a non-default stack size - * because the default on some OS's is too small. + * because the default on some OS's is too small. Also, make sure + * we're using a detached creation method so all resources are + * reclaimed when the thread exits. */ pthread_attr_init(&thread_attr); + pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_DETACHED); pthread_attr_setstacksize(&thread_attr, THREAD_STACK_SIZE); if (thread_config.maxclients == 0) { |