Hi,

in modperl_callback.c I have found this piece of code:

    if (r || c) {
        interp = modperl_interp_select(r, c, s);
        aTHX = interp->perl;
    }
    else {
        /* Child{Init,Exit}, OpenLogs */
        aTHX = scfg->mip->parent->perl;
        PERL_SET_CONTEXT(aTHX);
    }

"man perlembed" says:

       Note the calls to PERL_SET_CONTEXT().  These are necessary to initial‐
       ize the global state that tracks which interpreter is the "current" one
       on the particular process or thread that may be running it.  It should
       always be used if you have more than one interpreter and are making
       perl API calls on both interpreters in an interleaved fashion.

       PERL_SET_CONTEXT(interp) should also be called whenever "interp" is
       used by a thread that did not create it (using either perl_alloc(), or
       the more esoteric perl_clone()).

So, is it an error not to call PERL_SET_CONTEXT in the if-branch?

Shouldn't PERL_SET_CONTEXT be called every time an interpreter is selected?

Thanks,
Torsten

Attachment: pgpp883O4UXKW.pgp
Description: PGP signature

Reply via email to