summaryrefslogtreecommitdiff
path: root/sapi
diff options
context:
space:
mode:
authorUwe Schindler <thetaphi@php.net>2003-05-20 11:19:01 +0000
committerUwe Schindler <thetaphi@php.net>2003-05-20 11:19:01 +0000
commit1e4730fb70f23d613524a3c372d466143ce4deca (patch)
tree068f5b0d9b14565a904d9ec74621038c1cd048a8 /sapi
parent37a9e03654fb8ae4252624aa1ecf1734dd8b2fe0 (diff)
downloadphp-git-1e4730fb70f23d613524a3c372d466143ce4deca.tar.gz
Set exspected threads to tsrm_startup() to number of threads NSAPI returns for server
Diffstat (limited to 'sapi')
-rw-r--r--sapi/nsapi/nsapi.c11
1 files changed, 9 insertions, 2 deletions
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;
}