summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-07-05 11:55:18 +0000
committerMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-07-05 11:55:18 +0000
commitc03294656c9980c235cc5951a63088fd96d33704 (patch)
tree6e8191a8d83c36b157d11c7868c3d9c0e8ddcc8d /pp_ctl.c
parent462e5cf694f345fbf34a1f95e9a82957e59dcc2b (diff)
downloadperl-c03294656c9980c235cc5951a63088fd96d33704.tar.gz
Introduce pp_lock.
p4raw-id: //depot/perl@35
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c46
1 files changed, 0 insertions, 46 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 317ed70897..cd9a2105d2 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -1272,54 +1272,9 @@ const void *b;
return sv_cmp_locale(*(SV * const *)a, *(SV * const *)b);
}
-#ifdef USE_THREADS
-static void
-unlock_condpair(svv)
-void *svv;
-{
- dTHR;
- MAGIC *mg = mg_find((SV*)svv, 'm');
-
- if (!mg)
- croak("panic: unlock_condpair unlocking non-mutex");
- MUTEX_LOCK(MgMUTEXP(mg));
- if (MgOWNER(mg) != thr)
- croak("panic: unlock_condpair unlocking mutex that we don't own");
- MgOWNER(mg) = 0;
- COND_SIGNAL(MgOWNERCONDP(mg));
- MUTEX_UNLOCK(MgMUTEXP(mg));
-}
-#endif /* USE_THREADS */
-
PP(pp_reset)
{
dSP;
-#ifdef USE_THREADS
- dTOPss;
- MAGIC *mg;
-
- if (MAXARG < 1)
- croak("reset requires mutex argument with USE_THREADS");
- if (SvROK(sv)) {
- /*
- * Kludge to allow lock of real objects without requiring
- * to pass in every type of argument by explicit reference.
- */
- sv = SvRV(sv);
- }
- mg = condpair_magic(sv);
- MUTEX_LOCK(MgMUTEXP(mg));
- if (MgOWNER(mg) == thr)
- MUTEX_UNLOCK(MgMUTEXP(mg));
- else {
- while (MgOWNER(mg))
- COND_WAIT(MgOWNERCONDP(mg), MgMUTEXP(mg));
- MgOWNER(mg) = thr;
- MUTEX_UNLOCK(MgMUTEXP(mg));
- save_destructor(unlock_condpair, sv);
- }
- RETURN;
-#else
char *tmps;
if (MAXARG < 1)
@@ -1329,7 +1284,6 @@ PP(pp_reset)
sv_reset(tmps, curcop->cop_stash);
PUSHs(&sv_yes);
RETURN;
-#endif /* USE_THREADS */
}
PP(pp_lineseq)