From af345c1d2ccd9cf13c10e60c26e10272029baaaa Mon Sep 17 00:00:00 2001 From: Fabrice Fontaine Date: Fri, 1 Oct 2010 19:00:02 +0200 Subject: [PATCH] Adding --disable-notification-reordering option Adding a configure flag to disable GENA notification reordering as even with an imillisleep(1), this mechanism consumes too much CPU on embedded devices when there is a burst of notifications. (cherry picked from commit c73d870f46a9be94bc0e7b898dba4e480348933e) --- ChangeLog | 8 ++++++++ configure.ac | 5 +++++ upnp/src/gena/gena_device.c | 3 +++ 3 files changed, 16 insertions(+) diff --git a/ChangeLog b/ChangeLog index 419be56..53bc453 100644 --- a/ChangeLog +++ b/ChangeLog @@ -221,6 +221,14 @@ Version 1.8.0 Version 1.6.7 ******************************************************************************* +2010-10-01 Fabrice Fontaine + + Adding --disable-notification-reordering option + + Adding a configure flag to disable GENA notification reordering as even + with an imillisleep(1), this mechanism consumes too much CPU on embedded + devices when there is a burst of notifications. + 2010-09-30 Fabrice Fontaine Bug fix when there is no service in embedded devices diff --git a/configure.ac b/configure.ac index 950655f..344e65b 100644 --- a/configure.ac +++ b/configure.ac @@ -266,6 +266,11 @@ if test "x$enable_ipv6" = xyes ; then AC_DEFINE(UPNP_ENABLE_IPV6, 1, [see upnpconfig.h]) fi +RT_BOOL_ARG_ENABLE([notification_reordering], [yes], [GENA notification reordering in gena_device.c]) +if test "x$enable_notification_reordering" = xyes ; then + AC_DEFINE(UPNP_ENABLE_NOTIFICATION_REORDERING, 1, [see upnpconfig.h]) +fi + RT_BOOL_ARG_ENABLE([samples], [yes], [compilation of upnp/sample/ code]) diff --git a/upnp/src/gena/gena_device.c b/upnp/src/gena/gena_device.c index aa0512a..c2df364 100644 --- a/upnp/src/gena/gena_device.c +++ b/upnp/src/gena/gena_device.c @@ -365,6 +365,8 @@ static void genaNotifyThread( HandleUnlock(); return; } + +#ifdef UPNP_ENABLE_NOTIFICATION_REORDERING //If the event is out of order push it back to the job queue if( in->eventKey != sub->ToSendEventKey ) { @@ -383,6 +385,7 @@ static void genaNotifyThread( HandleUnlock(); return; } +#endif HandleUnlock();