On Thu, Jan 27, 2022 at 9:40 AM Ruediger Pluem <rpl...@apache.org> wrote:
>
> On 1/25/22 9:28 PM, yla...@apache.org wrote:
> >
> > -#if AP_HAS_THREAD_LOCAL
> > -    /* Create an apr_thread_t for the main child thread to set up its
> > -     * Thread Local Storage. Since it's detached and it won't
> > -     * apr_thread_exit(), destroy its pool before exiting via
> > -     * a pchild cleanup
> > -     */
> > -    {
> > -        apr_thread_t *main_thd = NULL;
> > -        apr_threadattr_t *main_thd_attr = NULL;
> > -        if (apr_threadattr_create(&main_thd_attr, pchild)
> > -                || apr_threadattr_detach_set(main_thd_attr, 1)
> > -                || ap_thread_current_create(&main_thd, main_thd_attr,
> > -                                            pchild)) {
> > -            ap_log_error(APLOG_MARK, APLOG_EMERG, 0, ap_server_conf, 
> > APLOGNO(10376)
> > -                         "Couldn't initialize child main thread");
> > -            exit(APEXIT_CHILDINIT);
> > -        }
> > -        apr_pool_cleanup_register(pchild, main_thd, main_thread_cleanup,
> > -                                  apr_pool_cleanup_null);
> > -    }
> > -#endif
> > -
>
> Why is this no longer needed?

Because Windows children processes run the main() too, so
ap_thread_main_create() has been called already.

Regards;
Yann.

Reply via email to