Make new() work exactly like create(). Move from Config::threads to threads::threads
Artur Bergman [Fri, 26 Oct 2001 12:31:46 +0000 (12:31 +0000)]
p4raw-id: //depot/perl@12676

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

index b708de4..506b247 100755 (executable)
@@ -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;
 
index 56c046d..a4e22ec 100755 (executable)
@@ -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: