httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ruediger Pluem <rpl...@apache.org>
Subject Re: svn commit: r1410459 - in /httpd/httpd/trunk: docs/log-message-tags/next-number server/mpm/event/event.c server/mpm/eventopt/eventopt.c
Date Sat, 17 Nov 2012 11:00:05 GMT


jim@apache.org wrote:
> Author: jim
> Date: Fri Nov 16 16:49:31 2012
> New Revision: 1410459
> 
> URL: http://svn.apache.org/viewvc?rev=1410459&view=rev
> Log:
> fdq expects a certain behavior from atomics... ensure that
> the event mpms check this.
> 
> Modified:
>     httpd/httpd/trunk/docs/log-message-tags/next-number
>     httpd/httpd/trunk/server/mpm/event/event.c
>     httpd/httpd/trunk/server/mpm/eventopt/eventopt.c
> 

> Modified: httpd/httpd/trunk/server/mpm/event/event.c
> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/event/event.c?rev=1410459&r1=1410458&r2=1410459&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/server/mpm/event/event.c (original)
> +++ httpd/httpd/trunk/server/mpm/event/event.c Fri Nov 16 16:49:31 2012
> @@ -2928,6 +2928,18 @@ static int event_pre_config(apr_pool_t *
>      }
>      ++retained->module_loads;
>      if (retained->module_loads == 2) {
> +        int i;
> +        static apr_uint32_t foo = 0;
> +
> +        apr_atomic_inc32(&foo);
> +        apr_atomic_dec32(&foo);
> +        apr_atomic_dec32(&foo);
> +        i = apr_atomic_dec32(&foo);
> +        if (i >= 0) {

Why can we expect i < 0? apr_atomic_dec32 returns 0 if the dec causes foo to become zero
and it returns non zero
otherwise. Shouldn't this behavior the same across all platforms? And if not should that be
fixed in APR?

> +            ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL, APLOGNO(02405)
> +                         "atomics not working as expected");
> +            return HTTP_INTERNAL_SERVER_ERROR;
> +        }
>          rv = apr_pollset_create(&event_pollset, 1, plog,
>                                  APR_POLLSET_THREADSAFE | APR_POLLSET_NOCOPY);
>          if (rv != APR_SUCCESS) {
> 
>

Regards

RĂ¼diger

Mime
View raw message