Explictly added the DETACHED creation method on threads.
This commit is contained in:
parent
2b781f537c
commit
28d955a3c8
@ -1,5 +1,8 @@
|
|||||||
2001-09-07 Robert James Kaes <rjkaes@flarenet.com>
|
2001-09-07 Robert James Kaes <rjkaes@flarenet.com>
|
||||||
|
|
||||||
|
* src/thread.c (thread_pool_create): Explictly set the detach
|
||||||
|
state for threads to PTHREAD_CREATE_DETACHED.
|
||||||
|
|
||||||
* Various error message clean up.
|
* Various error message clean up.
|
||||||
|
|
||||||
* src/thread.c (thread_main): Add locking around the
|
* src/thread.c (thread_main): Add locking around the
|
||||||
|
@ -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
|
* Handles the creation/destruction of the various threads required for
|
||||||
* processing incoming connections.
|
* processing incoming connections.
|
||||||
@ -175,9 +175,12 @@ short int thread_pool_create(void)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize thread_attr to contain a non-default stack size
|
* 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_init(&thread_attr);
|
||||||
|
pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_DETACHED);
|
||||||
pthread_attr_setstacksize(&thread_attr, THREAD_STACK_SIZE);
|
pthread_attr_setstacksize(&thread_attr, THREAD_STACK_SIZE);
|
||||||
|
|
||||||
if (thread_config.maxclients == 0) {
|
if (thread_config.maxclients == 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user