From: Artur Bergman Date: Fri, 26 Oct 2001 13:51:29 +0000 (+0000) Subject: Get the new functions right, do not export lock since we use builtin lock. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a6b94e59c1314554aecf82dac920b39053bd6bad;p=p5sagit%2Fp5-mst-13.2.git Get the new functions right, do not export lock since we use builtin lock. TODO: fix xsubpp to support the new prototypes p4raw-id: //depot/perl@12688 --- diff --git a/ext/threads/shared/shared.pm b/ext/threads/shared/shared.pm index 6868312..b212a41 100644 --- a/ext/threads/shared/shared.pm +++ b/ext/threads/shared/shared.pm @@ -9,18 +9,16 @@ use attributes qw(reftype); BEGIN { if($Config{'useithreads'} && $threads::threads) { *share = \&share_enabled; - *cond_wait = \&cond_wait_disabled; - *cond_signal = \&cond_signal_disabled; - *cond_broadcast = \&cond_broadcast_disabled; - *unlock = \&unlock_disabled; - *lock = \&lock_disabled; - } else { - *share = \&share_enabled; *cond_wait = \&cond_wait_enabled; *cond_signal = \&cond_signal_enabled; *cond_broadcast = \&cond_broadcast_enabled; *unlock = \&unlock_enabled; - *lock = \&lock_enabled; + } else { + *share = \&share_disabled; + *cond_wait = \&cond_wait_disabled; + *cond_signal = \&cond_signal_disabled; + *cond_broadcast = \&cond_broadcast_dosabled; + *unlock = \&unlock_disabled; } } @@ -28,7 +26,7 @@ require Exporter; require DynaLoader; our @ISA = qw(Exporter DynaLoader); -our @EXPORT = qw(share cond_wait cond_broadcast cond_signal unlock lock); +our @EXPORT = qw(share cond_wait cond_broadcast cond_signal unlock); our $VERSION = '0.01'; our %shared; diff --git a/ext/threads/shared/shared.xs b/ext/threads/shared/shared.xs index 34ed30c..eb4472d 100644 --- a/ext/threads/shared/shared.xs +++ b/ext/threads/shared/shared.xs @@ -194,7 +194,6 @@ _thrcnt_dec(ref) void unlock_enabled(ref) SV* ref - PROTOTYPE: \$ CODE: shared_sv* shared; if(SvROK(ref)) @@ -207,7 +206,6 @@ unlock_enabled(ref) void lock_enabled(ref) SV* ref - PROTOTYPE: \$ CODE: shared_sv* shared; if(SvROK(ref)) @@ -237,6 +235,7 @@ cond_wait_enabled(ref) COND_WAIT(&shared->user_cond, &shared->mutex); shared->owner = PERL_GET_CONTEXT; shared->locks = locks; + MUTEX_UNLOCK(&shared->mutex); void cond_signal_enabled(ref) SV* ref