summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-11-29 12:40:28 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-11-29 12:40:28 +0000
commitb099ddc068b2498767e6f04ac167d9633b895ec4 (patch)
treec5565911f062bddb5d68139f8aed5d8489d2a488 /pp_hot.c
parentbfc605f9e1d41dd7493c0c0fcfd1304c238dbe4d (diff)
downloadperl-b099ddc068b2498767e6f04ac167d9633b895ec4.tar.gz
various fixes for race conditions under threads: mutex locks based
on PL_threadnum were seriously flawed, since it means more than one thread could enter the critical region; PL_na was global instead of thread-local; child thread could finish and free thr structures before Thread->new() got around to creating the Thread object; cv_clone() needed locking, as it mucks with PL_comppad and other global data; new_struct_thread() needed to lock template-thread's mutex while copying its data p4raw-id: //depot/perl@2385
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 9b1791df5e..733b6b00f3 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -2170,8 +2170,7 @@ PP(pp_entersub)
* (3) instead of (2) so we'd have to clone. Would the fact
* that we released the mutex more quickly make up for this?
*/
- if (PL_threadnum &&
- (svp = hv_fetch(thr->cvcache, (char *)cv, sizeof(cv), FALSE)))
+ if ((svp = hv_fetch(thr->cvcache, (char *)cv, sizeof(cv), FALSE)))
{
/* We already have a clone to use */
MUTEX_UNLOCK(CvMUTEXP(cv));