diff --git a/ChangeLog b/ChangeLog index ac2a624..47699a0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,12 @@ Version 1.6.11 ******************************************************************************* +2011-02-07 Marcelo Roberto Jimenez + + Remove PrintThreadPoolStats() from the public API. This function uses + a ThreadPool object as an argument, which is not supposed to be + exported. + 2011-02-07 Fabrice Fontaine Major bug fix in IPv6 code. @@ -10,7 +16,7 @@ Version 1.6.11 changing implementation of get_port in November 20th 2010 ("gena:fix several compiler warnings" commit). -2011-02-11 Marcelo Roberto Jimenez +2011-02-06 Marcelo Roberto Jimenez Fix for incorrectly exported include files. diff --git a/upnp/inc/upnpdebug.h b/upnp/inc/upnpdebug.h index 295038b..45a86bb 100644 --- a/upnp/inc/upnpdebug.h +++ b/upnp/inc/upnpdebug.h @@ -283,33 +283,6 @@ static UPNP_INLINE void UpnpDisplayBanner(FILE *fd, const char **lines, } #endif -/*! - * \brief Prints thread pool statistics. - */ -#ifdef DEBUG -void PrintThreadPoolStats( - /*! [in] The thread pool. */ - ThreadPool * tp, - /*! [in] The file name that called this function, use the macro - * __FILE__. */ - const char *DbgFileName, - /*! [in] The line number that the function was called, use the macro - * __LINE__. */ - int DbgLineNo, - /*! [in] The message. */ - const char *msg); -#else -static UPNP_INLINE void PrintThreadPoolStats(ThreadPool *tp, - const char *DbgFileName, int DbgLineNo, const char *msg) -{ - return; - tp = tp; - DbgFileName = DbgFileName; - DbgLineNo = DbgLineNo; - msg = msg; -} -#endif - /*@}*/ #ifdef __cplusplus diff --git a/upnp/src/api/upnpapi.c b/upnp/src/api/upnpapi.c index 7437cb8..52f6d20 100644 --- a/upnp/src/api/upnpapi.c +++ b/upnp/src/api/upnpapi.c @@ -520,6 +520,66 @@ exit_function: } #endif +#ifdef DEBUG +/*! + * \brief Prints thread pool statistics. + */ +void PrintThreadPoolStats( + /*! [in] The thread pool. */ + ThreadPool *tp, + /*! [in] The file name that called this function, use the macro + * __FILE__. */ + const char *DbgFileName, + /*! [in] The line number that the function was called, use the macro + * __LINE__. */ + int DbgLineNo, + /*! [in] The message. */ + const char *msg) +{ + ThreadPoolStats stats; + ThreadPoolGetStats(tp, &stats); + UpnpPrintf(UPNP_INFO, API, DbgFileName, DbgLineNo, + "%s\n" + "High Jobs pending: %d\n" + "Med Jobs Pending: %d\n" + "Low Jobs Pending: %d\n" + "Average wait in High Q in milliseconds: %lf\n" + "Average wait in Med Q in milliseconds: %lf\n" + "Average wait in Low Q in milliseconds: %lf\n" + "Max Threads Used: %d\n" + "Worker Threads: %d\n" + "Persistent Threads: %d\n" + "Idle Threads: %d\n" + "Total Threads: %d\n" + "Total Work Time: %lf\n" + "Total Idle Time: %lf\n", + msg, + stats.currentJobsHQ, + stats.currentJobsMQ, + stats.currentJobsLQ, + stats.avgWaitHQ, + stats.avgWaitMQ, + stats.avgWaitLQ, + stats.maxThreads, + stats.workerThreads, + stats.persistentThreads, + stats.idleThreads, + stats.totalThreads, + stats.totalWorkTime, + stats.totalIdleTime); +} +#else +static UPNP_INLINE void PrintThreadPoolStats(ThreadPool *tp, + const char *DbgFileName, int DbgLineNo, const char *msg) +{ + return; + tp = tp; + DbgFileName = DbgFileName; + DbgLineNo = DbgLineNo; + msg = msg; +} +#endif /* DEBUG */ + int UpnpFinish(void) { #ifdef INCLUDE_DEVICE_APIS diff --git a/upnp/src/api/upnpdebug.c b/upnp/src/api/upnpdebug.c index b3dee52..3cf8d90 100644 --- a/upnp/src/api/upnpdebug.c +++ b/upnp/src/api/upnpdebug.c @@ -244,41 +244,4 @@ void UpnpDisplayBanner(FILE * fd, free(leftMargin); } -void PrintThreadPoolStats(ThreadPool *tp, - const char *DbgFileName, - int DbgLineNo, const char *msg) -{ - ThreadPoolStats stats; - ThreadPoolGetStats(tp, &stats); - UpnpPrintf(UPNP_INFO, API, DbgFileName, DbgLineNo, - "%s\n" - "High Jobs pending: %d\n" - "Med Jobs Pending: %d\n" - "Low Jobs Pending: %d\n" - "Average wait in High Q in milliseconds: %lf\n" - "Average wait in Med Q in milliseconds: %lf\n" - "Average wait in Low Q in milliseconds: %lf\n" - "Max Threads Used: %d\n" - "Worker Threads: %d\n" - "Persistent Threads: %d\n" - "Idle Threads: %d\n" - "Total Threads: %d\n" - "Total Work Time: %lf\n" - "Total Idle Time: %lf\n", - msg, - stats.currentJobsHQ, - stats.currentJobsMQ, - stats.currentJobsLQ, - stats.avgWaitHQ, - stats.avgWaitMQ, - stats.avgWaitLQ, - stats.maxThreads, - stats.workerThreads, - stats.persistentThreads, - stats.idleThreads, - stats.totalThreads, - stats.totalWorkTime, - stats.totalIdleTime); -} - #endif /* DEBUG */