From: Uwe Schindler Date: Tue, 20 May 2003 11:19:01 +0000 (+0000) Subject: Set exspected threads to tsrm_startup() to number of threads NSAPI returns for server X-Git-Tag: RELEASE_1_0_2~704 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1e4730fb70f23d613524a3c372d466143ce4deca;p=php Set exspected threads to tsrm_startup() to number of threads NSAPI returns for server --- diff --git a/sapi/nsapi/nsapi.c b/sapi/nsapi/nsapi.c index 8875c3799b..31252f34df 100644 --- a/sapi/nsapi/nsapi.c +++ b/sapi/nsapi/nsapi.c @@ -492,8 +492,15 @@ int NSAPI_PUBLIC php4_init(pblock *pb, Session *sn, Request *rq) { php_core_globals *core_globals; char *ini_path; + int threads=128; /* default for server */ + + /* fetch max threads from NSAPI and initialize TSRM with it */ +#if defined(pool_maxthreads) + threads=pool_maxthreads; + if (threads<1) threads=128; /* default for server */ +#endif + tsrm_startup(threads, 1, 0, NULL); - tsrm_startup(1, 1, 0, NULL); core_globals = ts_resource(core_globals_id); /* look if php_ini parameter is given to php4_init */ @@ -507,7 +514,7 @@ int NSAPI_PUBLIC php4_init(pblock *pb, Session *sn, Request *rq) daemon_atrestart(&php4_close, NULL); - log_error(LOG_INFORM, "php4_init", sn, rq, "Initialized PHP Module"); + log_error(LOG_INFORM, "php4_init", sn, rq, "Initialized PHP Module (%d threads exspected)", threads); return REQ_PROCEED; }