Get the new functions right, do not export lock since we use builtin lock.
Artur Bergman [Fri, 26 Oct 2001 13:51:29 +0000 (13:51 +0000)]
TODO: fix xsubpp to support the new prototypes

p4raw-id: //depot/perl@12688

ext/threads/shared/shared.pm
ext/threads/shared/shared.xs

index 6868312..b212a41 100644 (file)
@@ -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;
index 34ed30c..eb4472d 100644 (file)
@@ -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