develooper Front page | perl.perl5.porters | Postings from July 2001

Re: [patch] pthread_atfork bandaid

Thread Previous | Thread Next
From:
Doug MacEachern
Date:
July 11, 2001 22:53
Subject:
Re: [patch] pthread_atfork bandaid
Message ID:
Pine.LNX.4.21.0107112249300.28844-100000@mako.covalent.net
On Thu, 12 Jul 2001, Jarkko Hietaniemi wrote:
 
> Well, at the very least they need to be declared, then.  Otherwise the
> atfork_lock and atfork_unlock are were not visible in miniperlmain.c.

they are declared, but my patch put them in unixish.h, probably not the
right place, perl.h would probably do.
 
> > can you run 'make perl.i' and see if THX is really needed in the atfork
> > functions?  if it is, i don't see how this patch will work since the 
> 
> It works.

yeah, it compiles, but THX will not be passed to Perl_atfork_* when
pthread's fork() is called.  i think just moving the Perl_atfork_*
prototypes from unixish.h to a place where everything can see is the right
fix.  similar to how perl.h has:
Malloc_t Perl_malloc (MEM_SIZE nbytes);
Malloc_t Perl_calloc (MEM_SIZE elements, MEM_SIZE size);
Malloc_t Perl_realloc (Malloc_t where, MEM_SIZE nbytes);
without the THX/embed.pl magic.
 
> > pthread_atfork() handlers will not get passed any args.  i think they
> 
> The function pointer typedef was admittedly a bit icky... but without
> that part the Compaq C compiler get serious indigestion about mismatching
> function signatures at pthread_atfork().

right, which keeping the original 'void Perl_fork_*(void)' prototype
should cure with the ickyness.



Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About