summaryrefslogtreecommitdiff
path: root/ext/threads
diff options
context:
space:
mode:
authorArtur Bergman <sky@nanisky.com>2001-10-26 12:31:46 +0000
committerArtur Bergman <sky@nanisky.com>2001-10-26 12:31:46 +0000
commit8222d950c8d6de1b5e2b0ab47462f5dfd4bdf782 (patch)
tree9a18270c572452c9f33279b9fee5f418d3f176e9 /ext/threads
parent89e0305a042ccbf862532916368cdde36784686c (diff)
downloadperl-8222d950c8d6de1b5e2b0ab47462f5dfd4bdf782.tar.gz
Make new() work exactly like create(). Move from Config::threads to threads::threads
p4raw-id: //depot/perl@12676
Diffstat (limited to 'ext/threads')
-rwxr-xr-xext/threads/threads.pm7
-rwxr-xr-xext/threads/threads.xs18
2 files changed, 19 insertions, 6 deletions
diff --git a/ext/threads/threads.pm b/ext/threads/threads.pm
index b708de4461..506b2471c7 100755
--- a/ext/threads/threads.pm
+++ b/ext/threads/threads.pm
@@ -24,18 +24,13 @@ our @EXPORT = qw(
);
our $VERSION = '0.05';
-sub new {
- my $class = shift;
- return $class->create(@_);
-}
-
sub equals {
return 1 if($_[0]->tid() == $_[1]->tid());
return 0;
}
-$Config::threads = 1;
+$threads::threads = 1;
bootstrap threads $VERSION;
diff --git a/ext/threads/threads.xs b/ext/threads/threads.xs
index 56c046d0c2..a4e22ec966 100755
--- a/ext/threads/threads.xs
+++ b/ext/threads/threads.xs
@@ -332,6 +332,24 @@ create (class, function_to_call, ...)
RETVAL
SV *
+new (class, function_to_call, ...)
+ char * class
+ SV * function_to_call
+ CODE:
+ AV* params = newAV();
+ if(items > 2) {
+ int i;
+ for(i = 2; i < items ; i++) {
+ av_push(params, ST(i));
+ }
+ }
+ RETVAL = Perl_thread_create(class, function_to_call, newRV_noinc((SV*) params));
+ OUTPUT:
+ RETVAL
+
+
+
+SV *
self (class)
char* class
CODE: