On Sat, Nov 17, 2012 at 6:00 AM, Ruediger Pluem <rpl...@apache.org> wrote:

>
>
> j...@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?
>

icc (Intel) builds of httpd 2.4.7 event MPM (with apr-1.5.0) bomb here.

--enable-nonportable-atomics is specified for apr, though I haven't checked
what that does with icc.



> > +            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
>



-- 
Born in Roswell... married an alien...
http://emptyhammock.com/

Reply via email to