Charles Nepveu's suggestion of not allocating a thread for MiniServer when it is not compiled.

git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@398 119443c7-1b9e-41f8-b6fc-b9c35fce742c
This commit is contained in:
Marcelo Roberto Jimenez 2008-06-01 04:42:52 +00:00
parent bbb4478c81
commit 1401fce206
2 changed files with 17 additions and 6 deletions

View File

@ -2,6 +2,10 @@
Version 1.8.0
*******************************************************************************
2008-05-31 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
* Charles Nepveu's suggestion of not allocating a thread for
MiniServer when it is not compiled.
2008-05-26 Marcelo Jimenez <mroberto(at)users.sourceforge.net>
* SF Bug Tracker [ 1903069 ]
Subs (not services) not marked 'active'

View File

@ -113,7 +113,9 @@ TimerThread gTimerThread;
ThreadPool gSendThreadPool;
ThreadPool gRecvThreadPool;
ThreadPool gMiniServerThreadPool;
#ifdef INTERNAL_WEB_SERVER
ThreadPool gMiniServerThreadPool;
#endif
// Flag to indicate the state of web server
WebServerState bWebServerState = WEB_SERVER_DISABLED;
@ -302,7 +304,9 @@ int UpnpFinish()
}
PrintThreadPoolStats(&gSendThreadPool, __FILE__, __LINE__, "Send Thread Pool");
PrintThreadPoolStats(&gRecvThreadPool, __FILE__, __LINE__, "Recv Thread Pool");
#ifdef INTERNAL_WEB_SERVER
PrintThreadPoolStats(&gMiniServerThreadPool, __FILE__, __LINE__, "MiniServer Thread Pool");
#endif
#ifdef INCLUDE_DEVICE_APIS
if (GetDeviceHandleInfo(AF_INET, &device_handle, &temp) == HND_DEVICE ) {
@ -326,13 +330,14 @@ int UpnpFinish()
web_server_destroy();
#endif
#ifdef INTERNAL_WEB_SERVER
ThreadPoolShutdown(&gMiniServerThreadPool);
ThreadPoolShutdown(&gRecvThreadPool);
ThreadPoolShutdown(&gSendThreadPool);
PrintThreadPoolStats(&gSendThreadPool, __FILE__, __LINE__, "Send Thread Pool");
PrintThreadPoolStats(&gRecvThreadPool, __FILE__, __LINE__, "Recv Thread Pool");
PrintThreadPoolStats(&gMiniServerThreadPool, __FILE__, __LINE__, "MiniServer Thread Pool");
#endif
ThreadPoolShutdown(&gRecvThreadPool);
PrintThreadPoolStats(&gSendThreadPool, __FILE__, __LINE__, "Send Thread Pool");
ThreadPoolShutdown(&gSendThreadPool);
PrintThreadPoolStats(&gRecvThreadPool, __FILE__, __LINE__, "Recv Thread Pool");
#ifdef INCLUDE_CLIENT_APIS
ithread_mutex_destroy(&GlobalClientSubscribeMutex);
@ -3396,10 +3401,12 @@ int UpnpInitThreadPools()
goto ExitFunction;
}
#ifdef INTERNAL_WEB_SERVER
if (ThreadPoolInit(&gMiniServerThreadPool, &attr) != UPNP_E_SUCCESS) {
ret = UPNP_E_INIT_FAILED;
goto ExitFunction;
}
#endif
ExitFunction:
if (ret != UPNP_E_SUCCESS) {