summaryrefslogtreecommitdiff
path: root/ext/Thread
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>1998-07-18 16:38:27 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>1998-07-18 16:38:27 +0000
commit533c011aecf9bca2c9ad025efccd7b74ad222cda (patch)
tree842693196e76c6669b3d83287b1ed7dda8bf68c3 /ext/Thread
parent8f8722428a3062985b7d543348f72ccabf60a063 (diff)
downloadperl-533c011aecf9bca2c9ad025efccd7b74ad222cda.tar.gz
PL_ stuff for threads
p4raw-id: //depot/ansiperl@1534
Diffstat (limited to 'ext/Thread')
-rw-r--r--ext/Thread/Thread.xs56
1 files changed, 28 insertions, 28 deletions
diff --git a/ext/Thread/Thread.xs b/ext/Thread/Thread.xs
index 5d47cd0251..30ccaf47bf 100644
--- a/ext/Thread/Thread.xs
+++ b/ext/Thread/Thread.xs
@@ -25,13 +25,13 @@ remove_thread(struct perl_thread *t)
#ifdef USE_THREADS
DEBUG_L(WITH_THR(PerlIO_printf(PerlIO_stderr(),
"%p: remove_thread %p\n", thr, t)));
- MUTEX_LOCK(&threads_mutex);
+ MUTEX_LOCK(&PL_threads_mutex);
MUTEX_DESTROY(&t->mutex);
- nthreads--;
+ PL_nthreads--;
t->prev->next = t->next;
t->next->prev = t->prev;
- COND_BROADCAST(&nthreads_cond);
- MUTEX_UNLOCK(&threads_mutex);
+ COND_BROADCAST(&PL_nthreads_cond);
+ MUTEX_UNLOCK(&PL_threads_mutex);
#endif
}
@@ -82,7 +82,7 @@ threadstart(void *arg)
LOGOP myop;
djSP;
I32 oldmark = TOPMARK;
- I32 oldscope = scopestack_ix;
+ I32 oldscope = PL_scopestack_ix;
I32 retval;
SV *sv;
AV *av = newAV();
@@ -117,8 +117,8 @@ threadstart(void *arg)
PUTBACK;
perl_call_sv(sv, G_ARRAY|G_EVAL);
SPAGAIN;
- retval = SP - (stack_base + oldmark);
- SP = stack_base + oldmark + 1;
+ retval = SP - (PL_stack_base + oldmark);
+ SP = PL_stack_base + oldmark + 1;
if (SvCUR(thr->errsv)) {
MUTEX_LOCK(&thr->mutex);
thr->flags |= THRf_DID_DIE;
@@ -150,21 +150,21 @@ threadstart(void *arg)
SvREFCNT_dec(thr->errsv);
SvREFCNT_dec(thr->errhv);
- Safefree(markstack);
- Safefree(scopestack);
- Safefree(savestack);
- Safefree(retstack);
+ Safefree(PL_markstack);
+ Safefree(PL_scopestack);
+ Safefree(PL_savestack);
+ Safefree(PL_retstack);
Safefree(cxstack);
- Safefree(tmps_stack);
- Safefree(ofs);
+ Safefree(PL_tmps_stack);
+ Safefree(PL_ofs);
- SvREFCNT_dec(rs);
- SvREFCNT_dec(nrs);
- SvREFCNT_dec(statname);
- Safefree(screamfirst);
- Safefree(screamnext);
- Safefree(reg_start_tmp);
- SvREFCNT_dec(lastscream);
+ SvREFCNT_dec(PL_rs);
+ SvREFCNT_dec(PL_nrs);
+ SvREFCNT_dec(PL_statname);
+ Safefree(PL_screamfirst);
+ Safefree(PL_screamnext);
+ Safefree(PL_reg_start_tmp);
+ SvREFCNT_dec(PL_lastscream);
MUTEX_LOCK(&thr->mutex);
DEBUG_L(PerlIO_printf(PerlIO_stderr(),
@@ -519,10 +519,10 @@ list(classname)
* Iterate until we have enough dynamic storage for all threads.
* We mustn't do any allocation while holding threads_mutex though.
*/
- MUTEX_LOCK(&threads_mutex);
+ MUTEX_LOCK(&PL_threads_mutex);
do {
- n = nthreads;
- MUTEX_UNLOCK(&threads_mutex);
+ n = PL_nthreads;
+ MUTEX_UNLOCK(&PL_threads_mutex);
if (AvFILL(av) < n - 1) {
int i = AvFILL(av);
for (i = AvFILL(av); i < n - 1; i++) {
@@ -533,9 +533,9 @@ list(classname)
}
}
- MUTEX_LOCK(&threads_mutex);
- } while (n < nthreads);
- n = nthreads; /* Get the final correct value */
+ MUTEX_LOCK(&PL_threads_mutex);
+ } while (n < PL_nthreads);
+ n = PL_nthreads; /* Get the final correct value */
/*
* At this point, there's enough room to fill in av.
@@ -555,7 +555,7 @@ list(classname)
svp++;
} while (t != thr);
/* */
- MUTEX_UNLOCK(&threads_mutex);
+ MUTEX_UNLOCK(&PL_threads_mutex);
/* Truncate any unneeded slots in av */
av_fill(av, n - 1);
/* Finally, push all the new objects onto the stack and drop av */
@@ -577,7 +577,7 @@ kill_sighandler_thread()
void
init_thread_signals()
PPCODE:
- sighandlerp = handle_thread_signal;
+ PL_sighandlerp = handle_thread_signal;
if (pipe(sig_pipe) == -1)
XSRETURN_UNDEF;
PUSHs(&sv_yes);