summaryrefslogtreecommitdiff
path: root/ext/Thread
diff options
context:
space:
mode:
authorHugo van der Sanden <hv@crypt.org>2000-10-26 02:55:17 +0100
committerJarkko Hietaniemi <jhi@iki.fi>2000-10-26 04:49:16 +0000
commite01a9ca0f61dfca0a0ff0830bdab1ddd71342eec (patch)
tree40dd0d05a450d410657dcaf7c691dd7437a138ad /ext/Thread
parentdedcc4d4fc24baa272bfe8f4ae99d9497526bbb6 (diff)
downloadperl-e01a9ca0f61dfca0a0ff0830bdab1ddd71342eec.tar.gz
Re: [PATCH 5.6.0]Add non-blocking thread doneness checking
Message-Id: <200010260055.BAA27869@crypt.compulink.co.uk> minus one unneeded mutex lock/unlock pointed out by Dan Sugalski. p4raw-id: //depot/perl@7449
Diffstat (limited to 'ext/Thread')
-rw-r--r--ext/Thread/Thread.pm3
-rw-r--r--ext/Thread/Thread.xs4
2 files changed, 3 insertions, 4 deletions
diff --git a/ext/Thread/Thread.pm b/ext/Thread/Thread.pm
index 22ae4ef404..f8a8a26bbc 100644
--- a/ext/Thread/Thread.pm
+++ b/ext/Thread/Thread.pm
@@ -34,7 +34,6 @@ Thread - manipulate threads in Perl (EXPERIMENTAL, subject to change)
my $tid = Thread->self->tid;
my $tlist = Thread->list;
-
lock($scalar);
yield();
@@ -191,7 +190,7 @@ assigned starting with one.
The C<flags> method returns the flags for the thread. This is the
integer value corresponding to the internal flags for the thread, and
-the value man not be all that meaningful to you.
+the value may not be all that meaningful to you.
=item done
diff --git a/ext/Thread/Thread.xs b/ext/Thread/Thread.xs
index 27e2533f3e..c911279c1d 100644
--- a/ext/Thread/Thread.xs
+++ b/ext/Thread/Thread.xs
@@ -189,9 +189,9 @@ threadstart(void *arg)
SvREFCNT_dec(PL_lastscream);
SvREFCNT_dec(PL_defoutgv);
Safefree(PL_reg_poscache);
- thr->thr_done = 1;
MUTEX_LOCK(&thr->mutex);
+ thr->thr_done = 1;
DEBUG_S(PerlIO_printf(Perl_debug_log,
"%p: threadstart finishing: state is %u\n",
thr, ThrSTATE(thr)));
@@ -453,7 +453,7 @@ done(t)
Thread t
PPCODE:
#ifdef USE_THREADS
- PUSHs(t->thr_done ? &PL_sv_yes : &PL_sv_no);
+ PUSHs(t->thr_done ? &PL_sv_yes : &PL_sv_no);
#endif
void