summaryrefslogtreecommitdiff
path: root/run.c
diff options
context:
space:
mode:
authorMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-03-28 18:40:44 +0000
committerMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-03-28 18:40:44 +0000
commit11343788cbaaede18e3146b5219d2fbdaeaf516e (patch)
treeef2be09ece0508b3408a222a86980d39e20bcd42 /run.c
parenta4f68e9b64464684b732bc17fd65ed4a1aa4708c (diff)
downloadperl-11343788cbaaede18e3146b5219d2fbdaeaf516e.tar.gz
Initial 3-way merge from (5.001m, thr1m, 5.003) plus fixups.
p4raw-id: //depot/thrperl@4
Diffstat (limited to 'run.c')
-rw-r--r--run.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/run.c b/run.c
index 7c09f8f58b..dd178b9348 100644
--- a/run.c
+++ b/run.c
@@ -23,19 +23,21 @@ dEXT char *watchok;
int
runops() {
+ dTHR;
SAVEI32(runlevel);
runlevel++;
- while ( op = (*op->op_ppaddr)() ) ;
+ while ( op = (*op->op_ppaddr)(ARGS) ) ;
return 0;
}
#else
-static void debprof _((OP*op));
+static void debprof _((OP*o));
int
runops() {
+ dTHR;
if (!op) {
warn("NULL OP IN RUN");
return 0;
@@ -52,26 +54,29 @@ runops() {
DEBUG_s(debstack());
DEBUG_t(debop(op));
DEBUG_P(debprof(op));
+#ifdef USE_THREADS
+ DEBUG_L(pthread_yield()); /* shake up scheduling a bit */
+#endif /* USE_THREADS */
}
- } while ( op = (*op->op_ppaddr)() );
+ } while ( op = (*op->op_ppaddr)(ARGS) );
return 0;
}
I32
-debop(op)
-OP *op;
+debop(o)
+OP *o;
{
SV *sv;
- deb("%s", op_name[op->op_type]);
- switch (op->op_type) {
+ deb("%s", op_name[o->op_type]);
+ switch (o->op_type) {
case OP_CONST:
- fprintf(stderr, "(%s)", SvPEEK(cSVOP->op_sv));
+ fprintf(stderr, "(%s)", SvPEEK(cSVOPo->op_sv));
break;
case OP_GVSV:
case OP_GV:
- if (cGVOP->op_gv) {
+ if (cGVOPo->op_gv) {
sv = NEWSV(0,0);
- gv_fullname(sv, cGVOP->op_gv);
+ gv_fullname(sv, cGVOPo->op_gv);
fprintf(stderr, "(%s)", SvPV(sv, na));
SvREFCNT_dec(sv);
}
@@ -96,12 +101,12 @@ char **addr;
}
static void
-debprof(op)
-OP* op;
+debprof(o)
+OP* o;
{
if (!profiledata)
New(000, profiledata, MAXO, U32);
- ++profiledata[op->op_type];
+ ++profiledata[o->op_type];
}
void