diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-06-09 18:03:01 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-06-09 18:03:01 +0000 |
commit | cea2e8a9dd23747fd2b66edc86c58c64e9970321 (patch) | |
tree | 50e1ad203239e885681b4e804c46363e763ca432 /ext/Thread | |
parent | f019efd000a9017df645fb6c4cce1e7401ac9445 (diff) | |
download | perl-cea2e8a9dd23747fd2b66edc86c58c64e9970321.tar.gz |
more complete support for implicit thread/interpreter pointer,
enabled via -DPERL_IMPLICIT_CONTEXT (all changes are noops
without that enabled):
- USE_THREADS now enables PERL_IMPLICIT_CONTEXT, so dTHR
is a noop; tests pass on Solaris; should be faster now!
- MULTIPLICITY has been tested with and without
PERL_IMPLICIT_CONTEXT on Solaris
- improved function database now merged with embed.pl
- everything except the varargs functions have foo(a,b,c) macros
to provide compatibility
- varargs functions default to compatibility variants that
get the context pointer using dTHX
- there should be almost no source compatibility issues as a
result of all this
- dl_foo.xs changes other than dl_dlopen.xs untested
- still needs documentation, fixups for win32 etc
Next step: migrate most non-mutex variables from perlvars.h
to intrpvar.h
p4raw-id: //depot/perl@3524
Diffstat (limited to 'ext/Thread')
-rw-r--r-- | ext/Thread/Thread.xs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/ext/Thread/Thread.xs b/ext/Thread/Thread.xs index 8ae50d14a8..f8b544da91 100644 --- a/ext/Thread/Thread.xs +++ b/ext/Thread/Thread.xs @@ -20,7 +20,7 @@ static int sig_pipe[2]; #endif static void -remove_thread(struct perl_thread *t) +remove_thread(pTHX_ struct perl_thread *t) { #ifdef USE_THREADS DEBUG_S(WITH_THR(PerlIO_printf(PerlIO_stderr(), @@ -194,7 +194,7 @@ threadstart(void *arg) case THRf_R_JOINED: ThrSETSTATE(thr, THRf_DEAD); MUTEX_UNLOCK(&thr->mutex); - remove_thread(thr); + remove_thread(aTHX_ thr); DEBUG_S(PerlIO_printf(PerlIO_stderr(), "%p: R_JOINED thread finished\n", thr)); break; @@ -204,7 +204,7 @@ threadstart(void *arg) SvREFCNT_dec(av); DEBUG_S(PerlIO_printf(PerlIO_stderr(), "%p: DETACHED thread finished\n", thr)); - remove_thread(thr); /* This might trigger main thread to finish */ + remove_thread(aTHX_ thr); /* This might trigger main thread to finish */ break; default: MUTEX_UNLOCK(&thr->mutex); @@ -221,7 +221,7 @@ threadstart(void *arg) } static SV * -newthread (SV *startsv, AV *initargs, char *classname) +newthread (pTHX_ SV *startsv, AV *initargs, char *classname) { #ifdef USE_THREADS dSP; @@ -289,7 +289,7 @@ newthread (SV *startsv, AV *initargs, char *classname) savethread, thr, err)); /* Thread creation failed--clean up */ SvREFCNT_dec(thr->cvcache); - remove_thread(thr); + remove_thread(aTHX_ thr); MUTEX_DESTROY(&thr->mutex); for (i = 0; i <= AvFILL(initargs); i++) SvREFCNT_dec(*av_fetch(initargs, i, FALSE)); @@ -344,7 +344,7 @@ new(classname, startsv, ...) SV * startsv AV * av = av_make(items - 2, &ST(2)); PPCODE: - XPUSHs(sv_2mortal(newthread(startsv, av, classname))); + XPUSHs(sv_2mortal(newthread(aTHX_ startsv, av, classname))); void join(t) @@ -365,7 +365,7 @@ join(t) case THRf_ZOMBIE: ThrSETSTATE(t, THRf_DEAD); MUTEX_UNLOCK(&t->mutex); - remove_thread(t); + remove_thread(aTHX_ t); break; default: MUTEX_UNLOCK(&t->mutex); @@ -408,7 +408,7 @@ detach(t) ThrSETSTATE(t, THRf_DEAD); DETACH(t); MUTEX_UNLOCK(&t->mutex); - remove_thread(t); + remove_thread(aTHX_ t); break; default: MUTEX_UNLOCK(&t->mutex); |