r72055 - in /branches/upstream/libio-aio-perl/current: AIO.pm AIO.xs Changes MANIFEST META.json META.yml README bin/treescan libeio/config.h.in libeio/eio.c libeio/eio.h libeio/xthread.h t/04_fork.t

periapt-guest at users.alioth.debian.org periapt-guest at users.alioth.debian.org
Wed Mar 30 09:07:28 UTC 2011


Author: periapt-guest
Date: Wed Mar 30 09:07:03 2011
New Revision: 72055

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=72055
Log:
[svn-upgrade] new version libio-aio-perl (3.80)

Added:
    branches/upstream/libio-aio-perl/current/META.json
Removed:
    branches/upstream/libio-aio-perl/current/META.yml
Modified:
    branches/upstream/libio-aio-perl/current/AIO.pm
    branches/upstream/libio-aio-perl/current/AIO.xs
    branches/upstream/libio-aio-perl/current/Changes
    branches/upstream/libio-aio-perl/current/MANIFEST
    branches/upstream/libio-aio-perl/current/README
    branches/upstream/libio-aio-perl/current/bin/treescan
    branches/upstream/libio-aio-perl/current/libeio/config.h.in
    branches/upstream/libio-aio-perl/current/libeio/eio.c
    branches/upstream/libio-aio-perl/current/libeio/eio.h
    branches/upstream/libio-aio-perl/current/libeio/xthread.h
    branches/upstream/libio-aio-perl/current/t/04_fork.t

Modified: branches/upstream/libio-aio-perl/current/AIO.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-aio-perl/current/AIO.pm?rev=72055&op=diff
==============================================================================
--- branches/upstream/libio-aio-perl/current/AIO.pm (original)
+++ branches/upstream/libio-aio-perl/current/AIO.pm Wed Mar 30 09:07:03 2011
@@ -170,7 +170,7 @@
 use base 'Exporter';
 
 BEGIN {
-   our $VERSION = '3.71';
+   our $VERSION = '3.8';
 
    our @AIO_REQ = qw(aio_sendfile aio_read aio_write aio_open aio_close
                      aio_stat aio_lstat aio_unlink aio_rmdir aio_readdir aio_readdirx
@@ -184,7 +184,7 @@
 
    our @EXPORT = (@AIO_REQ, qw(aioreq_pri aioreq_nice));
    our @EXPORT_OK = qw(poll_fileno poll_cb poll_wait flush
-                       min_parallel max_parallel max_idle
+                       min_parallel max_parallel max_idle idle_timeout
                        nreqs nready npending nthreads
                        max_poll_time max_poll_reqs
                        sendfile fadvise madvise
@@ -260,6 +260,7 @@
    IO::AIO::min_parallel $nthreads
    IO::AIO::max_parallel $nthreads
    IO::AIO::max_idle $nthreads
+   IO::AIO::idle_timeout $seconds
    IO::AIO::max_outstanding $maxreqs
    IO::AIO::nreqs
    IO::AIO::nready
@@ -485,6 +486,15 @@
 Currently, the stats are always 64-bit-stats, i.e. instead of returning an
 error when stat'ing a large file, the results will be silently truncated
 unless perl itself is compiled with large file support.
+
+To help interpret the mode and dev/rdev stat values, IO::AIO offers the
+following constants and functions (if not implemented, the constants will
+be C<0> and the functions will either C<croak> or fall back on traditional
+behaviour).
+
+C<S_IFMT>, C<S_IFIFO>, C<S_IFCHR>, C<S_IFBLK>, C<S_IFLNK>, C<S_IFREG>,
+C<S_IFDIR>, C<S_IFWHT>, C<S_IFSOCK>, C<IO::AIO::major $dev_t>,
+C<IO::AIO::minor $dev_t>, C<IO::AIO::makedev $major, $minor>.
 
 Example: Print the length of F</etc/passwd>:
 
@@ -596,6 +606,8 @@
 
    aio_mknod $path, IO::AIO::S_IFIFO | $mode, 0, sub { ...
 
+See C<aio_stat> for info about some potentially helpful extra constants
+and functions.
 
 =item aio_link $srcpath, $dstpath, $callback->($status)
 
@@ -1516,10 +1528,11 @@
 
 =item IO::AIO::max_idle $nthreads
 
-Limit the number of threads (default: 4) that are allowed to idle (i.e.,
-threads that did not get a request to process within 10 seconds). That
-means if a thread becomes idle while C<$nthreads> other threads are also
-idle, it will free its resources and exit.
+Limit the number of threads (default: 4) that are allowed to idle
+(i.e., threads that did not get a request to process within the idle
+timeout (default: 10 seconds). That means if a thread becomes idle while
+C<$nthreads> other threads are also idle, it will free its resources and
+exit.
 
 This is useful when you allow a large number of threads (e.g. 100 or 1000)
 to allow for extremely high load situations, but want to free resources
@@ -1528,6 +1541,11 @@
 The default is probably ok in most situations, especially if thread
 creation is fast. If thread creation is very slow on your system you might
 want to use larger values.
+
+=item IO::AIO::idle_timeout $seconds
+
+Sets the minimum idle timeout (default 10) after which worker threads are
+allowed to exit. SEe C<IO::AIO::max_idle>.
 
 =item IO::AIO::max_outstanding $maxreqs
 

Modified: branches/upstream/libio-aio-perl/current/AIO.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-aio-perl/current/AIO.xs?rev=72055&op=diff
==============================================================================
--- branches/upstream/libio-aio-perl/current/AIO.xs (original)
+++ branches/upstream/libio-aio-perl/current/AIO.xs Wed Mar 30 09:07:03 2011
@@ -18,7 +18,7 @@
 #include <fcntl.h>
 #include <sched.h>
 
-#if _POSIX_MEMLOCK || _POSIX_MAPPED_FILES
+#if _POSIX_MEMLOCK || _POSIX_MEMLOCK_RANGE || _POSIX_MAPPED_FILES
 # include <sys/mman.h>
 #endif
 
@@ -210,6 +210,31 @@
 # define ST_RELATIME    0
 #endif
 
+#ifndef S_IFIFO
+# define S_IFIFO	0
+#endif
+#ifndef S_IFCHR
+# define S_IFCHR	0
+#endif
+#ifndef S_IFBLK
+# define S_IFBLK	0
+#endif
+#ifndef S_IFLNK
+# define S_IFLNK	0
+#endif
+#ifndef S_IFREG
+# define S_IFREG	0
+#endif
+#ifndef S_IFDIR
+# define S_IFDIR	0
+#endif
+#ifndef S_IFWHT
+# define S_IFWHT	0
+#endif
+#ifndef S_IFSOCK
+# define S_IFSOCK	0
+#endif
+
 #ifndef MAP_ANONYMOUS
 # ifdef MAP_ANON
 #  define MAP_ANONYMOUS MAP_ANON
@@ -231,6 +256,16 @@
 #endif
 #ifndef MAP_NONBLOCK
 # define MAP_NONBLOCK   0
+#endif
+
+#ifndef makedev
+# define makedev(maj,min) (((maj) << 8) | (min))
+#endif
+#ifndef major
+# define major(dev) ((dev) >> 8)
+#endif
+#ifndef minor
+# define minor(dev) ((dev) & 0xff)
 #endif
 
 #ifndef PAGESIZE
@@ -639,6 +674,9 @@
 #if !_POSIX_MAPPED_FILES
 # define mmap(addr,length,prot,flags,fd,offs) (errno = ENOSYS, -1)
 # define munmap(addr,length)                  (errno = ENOSYS, -1)
+#endif
+
+#if !_POSIX_MEMORY_PROTECTION
 # define mprotect(addr,len,prot)              (errno = ENOSYS, -1)
 # define PROT_NONE   0
 # define PROT_WRITE  0
@@ -728,9 +766,17 @@
     const_iv (O_TRUNC)
     const_iv (O_EXCL)
     const_iv (O_APPEND)
-#ifndef _WIN32
+
     const_iv (S_IFIFO)
-#endif
+    const_iv (S_IFCHR)
+    const_iv (S_IFBLK)
+    const_iv (S_IFLNK)
+    const_iv (S_IFREG)
+    const_iv (S_IFDIR)
+    const_iv (S_IFWHT)
+    const_iv (S_IFSOCK)
+    const_iv (S_IFMT)
+
     const_niv (FADV_NORMAL    , POSIX_FADV_NORMAL)
     const_niv (FADV_SEQUENTIAL, POSIX_FADV_SEQUENTIAL)
     const_niv (FADV_RANDOM    , POSIX_FADV_RANDOM)
@@ -822,7 +868,7 @@
 }
 
 void
-max_poll_reqs (int nreqs)
+max_poll_reqs (unsigned int nreqs)
 	PROTOTYPE: $
         CODE:
         eio_set_max_poll_reqs (nreqs);
@@ -834,25 +880,31 @@
         eio_set_max_poll_time (nseconds);
 
 void
-min_parallel (int nthreads)
+min_parallel (unsigned int nthreads)
 	PROTOTYPE: $
         CODE:
         eio_set_min_parallel (nthreads);
 
 void
-max_parallel (int nthreads)
+max_parallel (unsigned int nthreads)
 	PROTOTYPE: $
         CODE:
         eio_set_max_parallel (nthreads);
 
 void
-max_idle (int nthreads)
+max_idle (unsigned int nthreads)
 	PROTOTYPE: $
         CODE:
         eio_set_max_idle (nthreads);
 
 void
-max_outstanding (int maxreqs)
+idle_timeout (unsigned int seconds)
+	PROTOTYPE: $
+        CODE:
+        eio_set_idle_timeout (seconds);
+
+void
+max_outstanding (unsigned int maxreqs)
 	PROTOTYPE: $
         CODE:
         max_outstanding = maxreqs;
@@ -1062,6 +1114,22 @@
         REQ_SEND;
 }
 
+UV
+major (UV dev)
+	ALIAS:
+        minor = 1
+	CODE:
+        RETVAL = ix ? major (dev) : minor (dev);
+	OUTPUT:
+        RETVAL
+
+UV
+makedev (UV maj, UV min)
+	CODE:
+        RETVAL = makedev (maj, min);
+	OUTPUT:
+        RETVAL
+
 void
 aio_utime (SV8 *fh_or_path, SV *atime, SV *mtime, SV *callback=&PL_sv_undef)
 	PPCODE:
@@ -1526,7 +1594,7 @@
 
         addr = (void *)(((intptr_t)addr) + offset);
         eio_page_align (&addr, &len);
-#if _POSIX_MEMLOCK
+#if _POSIX_MEMLOCK_RANGE
         RETVAL = munlock (addr, len);
 #else
         RETVAL = ((errno = ENOSYS), -1);

Modified: branches/upstream/libio-aio-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-aio-perl/current/Changes?rev=72055&op=diff
==============================================================================
--- branches/upstream/libio-aio-perl/current/Changes (original)
+++ branches/upstream/libio-aio-perl/current/Changes Wed Mar 30 09:07:03 2011
@@ -9,6 +9,17 @@
 TODO: aio_mincore?
 TODO: add? also linux-specific stuff?
 TODO: O_EXEC O_SEARCH O_CLOEXEC O_DIRECTORY O_DSYNC O_NOCTTY O_NOFOLLOW O_NONBLOCK O_RSYNC O_SYNC O_TTY_INIT O_DIRECT O_LARGEFILE O_NOATIME O_ASYNC
+
+3.8  Sun Mar 27 12:25:33 CEST 2011
+	- use nonstandard but maybe-working-on-bsd fork technique.
+	- support a max_idle value of 0.
+	- support setting of idle timeout value (IO::AIO::idle_timeout).
+
+3.72 Fri Feb 11 04:25:38 CET 2011
+	- use _POSIX_MEMLOCK_RANGE to detetc mlock/munlock.
+        - aio_mknod always used a dev_t value of 0.
+        - new treescan option: --grep.
+        - add more S_IF macros, and major/minor/makedev "macros".
 
 3.71 Thu Dec 30 08:18:46 CET 2010
 	- the numerical result value passed to callbacks did not stringify

Modified: branches/upstream/libio-aio-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-aio-perl/current/MANIFEST?rev=72055&op=diff
==============================================================================
--- branches/upstream/libio-aio-perl/current/MANIFEST (original)
+++ branches/upstream/libio-aio-perl/current/MANIFEST Wed Mar 30 09:07:03 2011
@@ -28,4 +28,4 @@
 autogen.sh
 
 typemap
-META.yml                                 Module meta-data (added by MakeMaker)
+META.json                                Module meta-data (added by MakeMaker)

Added: branches/upstream/libio-aio-perl/current/META.json
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-aio-perl/current/META.json?rev=72055&op=file
==============================================================================
--- branches/upstream/libio-aio-perl/current/META.json (added)
+++ branches/upstream/libio-aio-perl/current/META.json Wed Mar 30 09:07:03 2011
@@ -1,0 +1,28 @@
+{
+   "no_index" : {
+      "directory" : [
+         "t",
+         "inc"
+      ]
+   },
+   "meta-spec" : {
+      "version" : 1.4,
+      "url" : "http://module-build.sourceforge.net/META-spec-v1.4.html"
+   },
+   "generated_by" : "ExtUtils::MakeMaker::JSONMETA version 7.000",
+   "distribution_type" : "module",
+   "version" : "3.8",
+   "name" : "IO-AIO",
+   "author" : [],
+   "license" : "unknown",
+   "build_requires" : {
+      "ExtUtils::MakeMaker" : 0
+   },
+   "requires" : {
+      "common::sense" : 0
+   },
+   "abstract" : null,
+   "configure_requires" : {
+      "ExtUtils::MakeMaker" : 0
+   }
+}

Modified: branches/upstream/libio-aio-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-aio-perl/current/README?rev=72055&op=diff
==============================================================================
--- branches/upstream/libio-aio-perl/current/README (original)
+++ branches/upstream/libio-aio-perl/current/README Wed Mar 30 09:07:03 2011
@@ -206,6 +206,7 @@
        IO::AIO::min_parallel $nthreads
        IO::AIO::max_parallel $nthreads
        IO::AIO::max_idle $nthreads
+       IO::AIO::idle_timeout $seconds
        IO::AIO::max_outstanding $maxreqs
        IO::AIO::nreqs
        IO::AIO::nready
@@ -415,6 +416,15 @@
         returning an error when stat'ing a large file, the results will be
         silently truncated unless perl itself is compiled with large file
         support.
+
+        To help interpret the mode and dev/rdev stat values, IO::AIO offers
+        the following constants and functions (if not implemented, the
+        constants will be 0 and the functions will either "croak" or fall
+        back on traditional behaviour).
+
+        "S_IFMT", "S_IFIFO", "S_IFCHR", "S_IFBLK", "S_IFLNK", "S_IFREG",
+        "S_IFDIR", "S_IFWHT", "S_IFSOCK", "IO::AIO::major $dev_t",
+        "IO::AIO::minor $dev_t", "IO::AIO::makedev $major, $minor".
 
         Example: Print the length of /etc/passwd:
 
@@ -513,6 +523,9 @@
 
            aio_mknod $path, IO::AIO::S_IFIFO | $mode, 0, sub { ...
 
+        See "aio_stat" for info about some potentially helpful extra
+        constants and functions.
+
     aio_link $srcpath, $dstpath, $callback->($status)
         Asynchronously create a new link to the existing object at $srcpath
         at the path $dstpath and call the callback with the result code.
@@ -1123,9 +1136,10 @@
 
     IO::AIO::max_idle $nthreads
         Limit the number of threads (default: 4) that are allowed to idle
-        (i.e., threads that did not get a request to process within 10
-        seconds). That means if a thread becomes idle while $nthreads other
-        threads are also idle, it will free its resources and exit.
+        (i.e., threads that did not get a request to process within the idle
+        timeout (default: 10 seconds). That means if a thread becomes idle
+        while $nthreads other threads are also idle, it will free its
+        resources and exit.
 
         This is useful when you allow a large number of threads (e.g. 100 or
         1000) to allow for extremely high load situations, but want to free
@@ -1135,6 +1149,10 @@
         The default is probably ok in most situations, especially if thread
         creation is fast. If thread creation is very slow on your system you
         might want to use larger values.
+
+    IO::AIO::idle_timeout $seconds
+        Sets the minimum idle timeout (default 10) after which worker
+        threads are allowed to exit. SEe "IO::AIO::max_idle".
 
     IO::AIO::max_outstanding $maxreqs
         This is a very bad function to use in interactive programs because

Modified: branches/upstream/libio-aio-perl/current/bin/treescan
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-aio-perl/current/bin/treescan?rev=72055&op=diff
==============================================================================
--- branches/upstream/libio-aio-perl/current/bin/treescan (original)
+++ branches/upstream/libio-aio-perl/current/bin/treescan Wed Mar 30 09:07:03 2011
@@ -11,7 +11,7 @@
 
 Getopt::Long::Configure ("bundling", "no_ignore_case", "require_order", "auto_help", "auto_version");
 
-my ($opt_silent, $opt_print0, $opt_stat, $opt_nodirs, $opt_nofiles);
+my ($opt_silent, $opt_print0, $opt_stat, $opt_nodirs, $opt_nofiles, $opt_grep);
 
 GetOptions
    "quiet|q"  => \$opt_silent,
@@ -19,13 +19,20 @@
    "stat|s"   => \$opt_stat,
    "dirs|d"   => \$opt_nofiles,
    "files|f"  => \$opt_nodirs,
+   "grep|g=s" => \$opt_grep,
    or die "Usage: try $0 --help";
 
 @ARGV = "." unless @ARGV;
 
+$opt_grep &&= qr{$opt_grep}s;
+
 sub printfn {
    my ($prefix, $files, $suffix) = @_;
 
+   if ($opt_grep) {
+      @$files = grep "$prefix$_" =~ $opt_grep, @$files;
+   }
+   
    if ($opt_print0) {
       print map "$prefix$_$suffix\0", @$files;
    } elsif (!$opt_silent) {

Modified: branches/upstream/libio-aio-perl/current/libeio/config.h.in
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-aio-perl/current/libeio/config.h.in?rev=72055&op=diff
==============================================================================
--- branches/upstream/libio-aio-perl/current/libeio/config.h.in (original)
+++ branches/upstream/libio-aio-perl/current/libeio/config.h.in Wed Mar 30 09:07:03 2011
@@ -57,6 +57,10 @@
 /* utimes(2) is available */
 #undef HAVE_UTIMES
 
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+   */
+#undef LT_OBJDIR
+
 /* Name of package */
 #undef PACKAGE
 

Modified: branches/upstream/libio-aio-perl/current/libeio/eio.c
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-aio-perl/current/libeio/eio.c?rev=72055&op=diff
==============================================================================
--- branches/upstream/libio-aio-perl/current/libeio/eio.c (original)
+++ branches/upstream/libio-aio-perl/current/libeio/eio.c Wed Mar 30 09:07:03 2011
@@ -1,7 +1,7 @@
 /*
  * libeio implementation
  *
- * Copyright (c) 2007,2008,2009,2010 Marc Alexander Lehmann <libeio at schmorp.de>
+ * Copyright (c) 2007,2008,2009,2010,2011 Marc Alexander Lehmann <libeio at schmorp.de>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without modifica-
@@ -81,7 +81,7 @@
 # include <signal.h>
 # include <dirent.h>
 
-#if _POSIX_MEMLOCK || _POSIX_MAPPED_FILES
+#if _POSIX_MEMLOCK || _POSIX_MEMLOCK_RANGE || _POSIX_MAPPED_FILES
 # include <sys/mman.h>
 #endif
 
@@ -134,9 +134,6 @@
 # define D_NAMLEN(de) strlen ((de)->d_name)
 #endif
 
-/* number of seconds after which an idle threads exit */
-#define IDLE_TIMEOUT 10
-
 /* used for struct dirent, AIX doesn't provide it */
 #ifndef NAME_MAX
 # define NAME_MAX 4096
@@ -225,12 +222,13 @@
 static volatile unsigned int nreqs;    /* reqlock */
 static volatile unsigned int nready;   /* reqlock */
 static volatile unsigned int npending; /* reqlock */
-static volatile unsigned int max_idle = 4;
-
-static xmutex_t wrklock = X_MUTEX_INIT;
-static xmutex_t reslock = X_MUTEX_INIT;
-static xmutex_t reqlock = X_MUTEX_INIT;
-static xcond_t  reqwait = X_COND_INIT;
+static volatile unsigned int max_idle = 4;      /* maximum number of threads that can idle indefinitely */
+static volatile unsigned int idle_timeout = 10; /* number of seconds after which an idle threads exit */
+
+static xmutex_t wrklock;
+static xmutex_t reslock;
+static xmutex_t reqlock;
+static xcond_t  reqwait;
 
 #if !HAVE_PREADWRITE
 /*
@@ -370,6 +368,14 @@
   abort ();
 }
 
+static void etp_thread_init (void)
+{
+  X_MUTEX_CREATE (wrklock);
+  X_MUTEX_CREATE (reslock);
+  X_MUTEX_CREATE (reqlock);
+  X_COND_CREATE  (reqwait);
+}
+
 static void etp_atfork_prepare (void)
 {
   X_LOCK (wrklock);
@@ -417,12 +423,13 @@
   nready   = 0;
   npending = 0;
 
-  etp_atfork_parent ();
+  etp_thread_init ();
 }
 
 static void
 etp_once_init (void)
-{    
+{
+  etp_thread_init ();
   X_THREAD_ATFORK (etp_atfork_prepare, etp_atfork_parent, etp_atfork_child);
 }
 
@@ -623,7 +630,14 @@
 static void etp_set_max_idle (unsigned int nthreads)
 {
   if (WORDACCESS_UNSAFE) X_LOCK   (reqlock);
-  max_idle = nthreads <= 0 ? 1 : nthreads;
+  max_idle = nthreads;
+  if (WORDACCESS_UNSAFE) X_UNLOCK (reqlock);
+}
+
+static void etp_set_idle_timeout (unsigned int seconds)
+{
+  if (WORDACCESS_UNSAFE) X_LOCK   (reqlock);
+  idle_timeout = seconds;
   if (WORDACCESS_UNSAFE) X_UNLOCK (reqlock);
 }
 
@@ -759,6 +773,11 @@
 void eio_set_max_idle (unsigned int nthreads)
 {
   etp_set_max_idle (nthreads);
+}
+
+void eio_set_idle_timeout (unsigned int seconds)
+{
+  etp_set_idle_timeout (seconds);
 }
 
 void eio_set_min_parallel (unsigned int nthreads)
@@ -1433,17 +1452,8 @@
 }
 
 #if !_POSIX_MEMLOCK
-# define eio__mlock(a,b) ((errno = ENOSYS), -1)
 # define eio__mlockall(a) ((errno = ENOSYS), -1)
 #else
-
-static int
-eio__mlock (void *addr, size_t length)
-{
-  eio_page_align (&addr, &length);
-
-  return mlock (addr, length);
-}
 
 static int
 eio__mlockall (int flags)
@@ -1463,6 +1473,20 @@
 
   return mlockall (flags);
 }
+#endif
+
+#if !_POSIX_MEMLOCK_RANGE
+# define eio__mlock(a,b) ((errno = ENOSYS), -1)
+#else
+
+static int
+eio__mlock (void *addr, size_t length)
+{
+  eio_page_align (&addr, &length);
+
+  return mlock (addr, length);
+}
+
 #endif
 
 #if !(_POSIX_MAPPED_FILES && _POSIX_SYNCHRONIZED_IO)
@@ -1548,7 +1572,7 @@
 
           ++idle;
 
-          ts.tv_sec = time (0) + IDLE_TIMEOUT;
+          ts.tv_sec = time (0) + idle_timeout;
           if (X_COND_TIMEDWAIT (reqwait, reqlock, ts) == ETIMEDOUT)
             {
               if (idle > max_idle)
@@ -1678,7 +1702,7 @@
       case EIO_RENAME:    req->result = rename    (req->ptr1, req->ptr2); break;
       case EIO_LINK:      req->result = link      (req->ptr1, req->ptr2); break;
       case EIO_SYMLINK:   req->result = symlink   (req->ptr1, req->ptr2); break;
-      case EIO_MKNOD:     req->result = mknod     (req->ptr1, (mode_t)req->int2, (dev_t)req->int3); break;
+      case EIO_MKNOD:     req->result = mknod     (req->ptr1, (mode_t)req->int2, (dev_t)req->offs); break;
 
       case EIO_READLINK:  ALLOC (PATH_MAX);
                           req->result = readlink  (req->ptr1, req->ptr2, PATH_MAX); break;
@@ -1938,7 +1962,7 @@
 
 eio_req *eio_mknod (const char *path, mode_t mode, dev_t dev, int pri, eio_cb cb, void *data)
 {
-  REQ (EIO_MKNOD); PATH; req->int2 = (long)mode; req->int3 = (long)dev; SEND;
+  REQ (EIO_MKNOD); PATH; req->int2 = (long)mode; req->offs = (off_t)dev; SEND;
 }
 
 static eio_req *

Modified: branches/upstream/libio-aio-perl/current/libeio/eio.h
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-aio-perl/current/libeio/eio.h?rev=72055&op=diff
==============================================================================
--- branches/upstream/libio-aio-perl/current/libeio/eio.h (original)
+++ branches/upstream/libio-aio-perl/current/libeio/eio.h Wed Mar 30 09:07:03 2011
@@ -1,7 +1,7 @@
 /*
  * libeio API header
  *
- * Copyright (c) 2007,2008,2009,2010 Marc Alexander Lehmann <libeio at schmorp.de>
+ * Copyright (c) 2007,2008,2009,2010,2011 Marc Alexander Lehmann <libeio at schmorp.de>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without modifica-
@@ -182,7 +182,7 @@
   eio_req volatile *next; /* private ETP */
 
   ssize_t result;  /* result of syscall, e.g. result = read (... */
-  off_t offs;      /* read, write, truncate, readahead, sync_file_range: file offset */
+  off_t offs;      /* read, write, truncate, readahead, sync_file_range: file offset, mknod: dev_t */
   size_t size;     /* read, write, readahead, sendfile, msync, mlock, sync_file_range: length */
   void *ptr1;      /* all applicable requests: pathname, old name; readdir: optional eio_dirents */
   void *ptr2;      /* all applicable requests: new name or memory buffer; readdir: name strings */
@@ -192,7 +192,7 @@
   int type;        /* EIO_xxx constant ETP */
   int int1;        /* all applicable requests: file descriptor; sendfile: output fd; open, msync, mlockall, readdir: flags */
   long int2;       /* chown, fchown: uid; sendfile: input fd; open, chmod, mkdir, mknod: file mode, sync_file_range: flags */
-  long int3;       /* chown, fchown: gid; mknod: dev_t */
+  long int3;       /* chown, fchown: gid */
   int errorno;     /* errno value on syscall return */
 
   unsigned char flags; /* private */
@@ -241,6 +241,7 @@
 void eio_set_min_parallel (unsigned int nthreads);
 void eio_set_max_parallel (unsigned int nthreads);
 void eio_set_max_idle     (unsigned int nthreads);
+void eio_set_idle_timeout (unsigned int seconds);
 
 unsigned int eio_nreqs    (void); /* number of requests in-flight */
 unsigned int eio_nready   (void); /* number of not-yet handled requests */

Modified: branches/upstream/libio-aio-perl/current/libeio/xthread.h
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-aio-perl/current/libeio/xthread.h?rev=72055&op=diff
==============================================================================
--- branches/upstream/libio-aio-perl/current/libeio/xthread.h (original)
+++ branches/upstream/libio-aio-perl/current/libeio/xthread.h Wed Mar 30 09:07:03 2011
@@ -29,6 +29,7 @@
 #include <windows.h>
 #include <pthread.h>
 #define sigset_t int
+#define sigfillset(a)
 #define pthread_sigmask(a,b,c)
 #define sigaddset(a,b)
 #define sigemptyset(s)
@@ -36,11 +37,13 @@
 
 typedef pthread_mutex_t xmutex_t;
 #define X_MUTEX_INIT           PTHREAD_MUTEX_INITIALIZER
+#define X_MUTEX_CREATE(mutex)  pthread_mutex_init (&(mutex), 0)
 #define X_LOCK(mutex)          pthread_mutex_lock (&(mutex))
 #define X_UNLOCK(mutex)        pthread_mutex_unlock (&(mutex))
 
 typedef pthread_cond_t xcond_t;
 #define X_COND_INIT                     PTHREAD_COND_INITIALIZER
+#define X_COND_CREATE(cond)		pthread_cond_init (&(cond), 0)
 #define X_COND_SIGNAL(cond)             pthread_cond_signal (&(cond))
 #define X_COND_WAIT(cond,mutex)         pthread_cond_wait (&(cond), &(mutex))
 #define X_COND_TIMEDWAIT(cond,mutex,to) pthread_cond_timedwait (&(cond), &(mutex), &(to))
@@ -95,18 +98,27 @@
 
 typedef pthread_mutex_t xmutex_t;
 #if __linux && defined (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP)
-# define X_MUTEX_INIT PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
+# define X_MUTEX_INIT		PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
+# define X_MUTEX_CREATE(mutex)						\
+  do {									\
+    pthread_mutexattr_t attr;						\
+    pthread_mutexattr_init (&attr);					\
+    pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_ADAPTIVE_NP);	\
+    pthread_mutex_init (&(mutex), &attr);				\
+  } while (0)
 #else
-# define X_MUTEX_INIT PTHREAD_MUTEX_INITIALIZER
+# define X_MUTEX_INIT		PTHREAD_MUTEX_INITIALIZER
+# define X_MUTEX_CREATE(mutex)	pthread_mutex_init (&(mutex), 0)
 #endif
-#define X_LOCK(mutex)   pthread_mutex_lock   (&(mutex))
-#define X_UNLOCK(mutex) pthread_mutex_unlock (&(mutex))
+#define X_LOCK(mutex)		pthread_mutex_lock   (&(mutex))
+#define X_UNLOCK(mutex)		pthread_mutex_unlock (&(mutex))
 
 typedef pthread_cond_t xcond_t;
-#define X_COND_INIT PTHREAD_COND_INITIALIZER
-#define X_COND_SIGNAL(cond) pthread_cond_signal (&(cond))
-#define X_COND_WAIT(cond,mutex) pthread_cond_wait (&(cond), &(mutex))
-#define X_COND_TIMEDWAIT(cond,mutex,to) pthread_cond_timedwait (&(cond), &(mutex), &(to))
+#define X_COND_INIT			PTHREAD_COND_INITIALIZER
+#define X_COND_CREATE(cond)		pthread_cond_init (&(cond), 0)
+#define X_COND_SIGNAL(cond)		pthread_cond_signal (&(cond))
+#define X_COND_WAIT(cond,mutex)		pthread_cond_wait (&(cond), &(mutex))
+#define X_COND_TIMEDWAIT(cond,mutex,to)	pthread_cond_timedwait (&(cond), &(mutex), &(to))
 
 typedef pthread_t xthread_t;
 #define X_THREAD_PROC(name) static void *name (void *thr_arg)

Modified: branches/upstream/libio-aio-perl/current/t/04_fork.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libio-aio-perl/current/t/04_fork.t?rev=72055&op=diff
==============================================================================
--- branches/upstream/libio-aio-perl/current/t/04_fork.t (original)
+++ branches/upstream/libio-aio-perl/current/t/04_fork.t Wed Mar 30 09:07:03 2011
@@ -5,12 +5,17 @@
 
 # this is a lame test, but....
 
-BEGIN { plan tests => 9 }
+BEGIN { plan tests => 10 }
 
 IO::AIO::min_parallel 2;
 
-aio_nop sub {
+IO::AIO::aio_nop sub {
    print "ok 6\n";
+};
+
+IO::AIO::aio_busy 0.2, sub {
+   print "ok 8\n";
+
 };
 
 print "ok 1\n";
@@ -22,7 +27,7 @@
    };
    print "ok 5\n";
    IO::AIO::poll while IO::AIO::nreqs;
-   print "ok 8\n";
+   print "ok 9\n";
 } else {
    print "ok 2\n";
    aio_stat "/", sub {
@@ -33,5 +38,5 @@
    exit;
 }
 
-print "ok 9\n";
+print "ok 10\n";
 




More information about the Pkg-perl-cvs-commits mailing list