[libev-perl] 01/06: Imported Upstream version 4.17
gregor herrmann
gregoa at debian.org
Sun May 11 16:44:54 UTC 2014
This is an automated email from the git hooks/post-receive script.
gregoa pushed a commit to branch master
in repository libev-perl.
commit 4cd47146e82cf938cb24523f3371d878b73730b1
Author: gregor herrmann <gregoa at debian.org>
Date: Sun May 11 18:29:21 2014 +0200
Imported Upstream version 4.17
---
Changes | 21 +++++++++++
EV.pm | 5 ++-
EV.xs | 26 ++++++++++---
META.json | 10 ++---
META.yml | 4 +-
Makefile.PL | 10 ++---
README | 2 +-
libev/Changes | 14 +++++++
libev/LICENSE | 2 +-
libev/ev.c | 109 +++++++++++++++++++++++++++++++++++++++++++-----------
libev/ev.h | 8 ++--
libev/ev.pod | 20 ++++++----
libev/ev_kqueue.c | 2 +-
libev/ev_vars.h | 8 ++--
libev/ev_win32.c | 2 +-
schmorp.h | 8 ++--
16 files changed, 188 insertions(+), 63 deletions(-)
diff --git a/Changes b/Changes
index 852928d..272c8fe 100644
--- a/Changes
+++ b/Changes
@@ -2,6 +2,27 @@ Revision history for Perl extension EV
Changes marked with (libev) are changes in libev, and have more
documentation in the libev Changes file.
+TODO: better multiarch detection
+
+4.17 Fri Apr 11 06:22:38 CEST 2014
+ - perl5porters broke Async::Interrupt, BDB, EV, IO::AIO, OpenCL
+ without warning by switching the meaning of USE_SOCKETS_AS_HANDLES
+ in 5.18. What's so attractive about giving a shit about backwards
+ compatibility - I will never understand.
+
+4.16 Sat Mar 8 16:49:05 CET 2014
+ - make sure EV::CHECK is available at all times.
+ - avoid a spurious warning when perl -w overrides "no warnings".
+ - use perl's signal implementation on WIN32.
+ - ensure extern "C" function pointers are used for externally-visible
+ pointers.
+ - (libev) mark event pipe fd as cloexec after a fork (analyzed by Sami Farin).
+ - (ecb) support m68k, m88k and sh (patch by Miod Vallat).
+ - (libev) in the absence of autoconf, do not use the clock syscall
+ on glibc >= 2.17 (avoids the syscall AND -lrt on systems
+ doing clock_gettime in userspace).
+ - (ecb) work around memory barriers and volatile apparently both being
+ broken in visual studio 2008 and later (analysed and patch by Nicolas Noble).
4.15 Fri Mar 1 12:15:53 CET 2013
- (libev) upgrade to 4.15 - too many changes to list.
diff --git a/EV.pm b/EV.pm
index d1d1f5e..70d5d8b 100644
--- a/EV.pm
+++ b/EV.pm
@@ -121,8 +121,9 @@ package EV;
use common::sense;
BEGIN {
- our $VERSION = '4.15';
+ our $VERSION = '4.17';
use XSLoader;
+ local $^W = 0; # avoid spurious warning
XSLoader::load "EV", $VERSION;
}
@@ -683,7 +684,7 @@ time:
my $hourly = EV::periodic 0, 3600, 0, sub { print "once/hour\n" };
That doesn't mean there will always be 3600 seconds in between triggers,
-but only that the the clalback will be called when the system time shows a
+but only that the the callback will be called when the system time shows a
full hour (UTC).
Another way to think about it (for the mathematically inclined) is that
diff --git a/EV.xs b/EV.xs
index 6ef81ac..3a9cbc1 100644
--- a/EV.xs
+++ b/EV.xs
@@ -3,8 +3,10 @@
#include "XSUB.h"
/* fix perl api breakage */
-#undef signal
-#undef sigaction
+#ifndef WIN32
+# undef signal
+# undef sigaction
+#endif
#include "schmorp.h"
@@ -15,6 +17,10 @@ sv_fileno (SV *fh)
return s_fileno (fh, 0);
}
+#ifndef GvCV_set
+# define GvCV_set(gv,cv) GvCV (gv) = cv
+#endif
+
#define EV_STANDALONE 1
#define EV_PROTOTYPES 1
#define EV_USE_NANOSLEEP EV_USE_MONOTONIC
@@ -33,7 +39,7 @@ sv_fileno (SV *fh)
/* due to bugs in OS X we have to use libev/ explicitly here */
#include "libev/ev.c"
-#if !defined _WIN32 && !defined _MINIX
+#if !defined _WIN32 && !defined _MINIX && !EV_NO_ATFORK
# include <pthread.h>
#endif
@@ -383,7 +389,7 @@ BOOT:
const_iv (EV_, STAT)
const_iv (EV_, IDLE)
const_iv (EV_, PREPARE)
- const_iv (EV_, CHECK)
+ /*const_iv (EV_, CHECK) needs special tretament */
const_iv (EV_, EMBED)
const_iv (EV_, FORK)
const_iv (EV_, CLEANUP)
@@ -428,6 +434,16 @@ BOOT:
for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ > const_iv; civ--)
newCONSTSUB (stash, (char *)civ[-1].name, newSViv (civ[-1].iv));
+ /* since this clashes with perl CHECK blocks, */
+ /* but we are interested in constants, */
+ /* and not blocks, we treat CHECK specially. */
+ {
+ /* the local $^W = 0 takes care of the warning */
+ CV *cv = newCONSTSUB (stash, "CHECK", newSViv (EV_CHECK));
+ /* now we need to re-set the gv, in case it was hijacked */
+ GvCV_set (gv_fetchpv ("EV::CHECK", GV_ADD, SVt_PVCV), cv);
+ }
+
stash_loop = gv_stashpv ("EV::Loop" , 1);
stash_watcher = gv_stashpv ("EV::Watcher" , 1);
stash_io = gv_stashpv ("EV::IO" , 1);
@@ -519,7 +535,7 @@ BOOT:
sv_setiv (sv, (IV)&evapi);
SvREADONLY_on (sv);
}
-#if !defined _WIN32 && !defined _MINIX
+#if !defined _WIN32 && !defined _MINIX && !EV_NO_ATFORK
#if __linux
int __register_atfork(void (*prepare) (void), void (*parent) (void), void (*child) (void), void * __dso_handle);
__register_atfork (0, 0, default_fork, 0);
diff --git a/META.json b/META.json
index 1a9ff34..215c6c0 100644
--- a/META.json
+++ b/META.json
@@ -4,7 +4,7 @@
"unknown"
],
"dynamic_config" : 1,
- "generated_by" : "ExtUtils::MakeMaker version 6.64, CPAN::Meta::Converter version 2.112621",
+ "generated_by" : "ExtUtils::MakeMaker version 6.86, CPAN::Meta::Converter version 2.133380",
"license" : [
"unknown"
],
@@ -22,20 +22,20 @@
"prereqs" : {
"build" : {
"requires" : {
- "ExtUtils::MakeMaker" : 0
+ "ExtUtils::MakeMaker" : "0"
}
},
"configure" : {
"requires" : {
- "ExtUtils::MakeMaker" : 0
+ "ExtUtils::MakeMaker" : "0"
}
},
"runtime" : {
"requires" : {
- "common::sense" : 0
+ "common::sense" : "0"
}
}
},
"release_status" : "stable",
- "version" : "4.15"
+ "version" : "4.17"
}
diff --git a/META.yml b/META.yml
index ea87e28..548a9ab 100644
--- a/META.yml
+++ b/META.yml
@@ -7,7 +7,7 @@ build_requires:
configure_requires:
ExtUtils::MakeMaker: 0
dynamic_config: 1
-generated_by: 'ExtUtils::MakeMaker version 6.64, CPAN::Meta::Converter version 2.112621'
+generated_by: 'ExtUtils::MakeMaker version 6.86, CPAN::Meta::Converter version 2.133380'
license: unknown
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -19,4 +19,4 @@ no_index:
- inc
requires:
common::sense: 0
-version: 4.15
+version: 4.17
diff --git a/Makefile.PL b/Makefile.PL
index 9fcf03b..ad4246c 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -294,11 +294,11 @@ WriteMakefile(
},
VERSION_FROM => "EV.pm",
PM => {
- 'EV.pm' => '$(INST_LIBDIR)/EV.pm',
- 'EV/EVAPI.h' => '$(INST_LIBDIR)/EV/EVAPI.h',
- 'EV/MakeMaker.pm' => '$(INST_LIBDIR)/EV/MakeMaker.pm',
- 'libev/ev.h' => '$(INST_LIBDIR)/EV/ev.h',
- 'libev/ev.pod' => '$(INST_LIBDIR)/EV/libev.pod',
+ 'EV.pm' => '$(INST_LIB)/EV.pm',
+ 'EV/EVAPI.h' => '$(INST_LIB)/EV/EVAPI.h',
+ 'EV/MakeMaker.pm' => '$(INST_LIB)/EV/MakeMaker.pm',
+ 'libev/ev.h' => '$(INST_LIB)/EV/ev.h',
+ 'libev/ev.pod' => '$(INST_LIB)/EV/libev.pod',
},
MAN3PODS => {
'EV.pm' => '$(INST_MAN3DIR)/EV.$(MAN3EXT)',
diff --git a/README b/README
index 42f654c..c9cc10c 100644
--- a/README
+++ b/README
@@ -560,7 +560,7 @@ WATCHER TYPES
my $hourly = EV::periodic 0, 3600, 0, sub { print "once/hour\n" };
That doesn't mean there will always be 3600 seconds in between
- triggers, but only that the the clalback will be called when the
+ triggers, but only that the the callback will be called when the
system time shows a full hour (UTC).
Another way to think about it (for the mathematically inclined)
diff --git a/libev/Changes b/libev/Changes
index 00a03f1..ed3f2b0 100644
--- a/libev/Changes
+++ b/libev/Changes
@@ -12,6 +12,20 @@ TODO: document file descriptor usage per loop
TODO: store loop pid_t and compare isndie signal handler,store 1 for same, 2 for differign pid, clean up in loop_fork
TODO: embed watchers need updating when fd changes
TODO: document portbaility requirements for atomic pointer access
+TODO: possible cb aliasing?
+TODO: document requirements for function piinters and calling conventions.
+
+ - mark event pipe fd as cloexec after a fork (analyzed by Sami Farin).
+ - (ecb) support m68k, m88k and sh (patch by Miod Vallat).
+ - use a reasonable fallback for EV_NSIG instead of erroring out
+ when we can't detect the signal set size.
+ - in the absence of autoconf, do not use the clock syscall
+ on glibc >= 2.17 (avoids the syscall AND -lrt on systems
+ doing clock_gettime in userspace).
+ - ensure extern "C" function pointers are used for externally-visible
+ loop callbacks (not watcher callbacks yet).
+ - (ecb) work around memory barriers and volatile apparently both being
+ broken in visual studio 2008 and later (analysed and patch by Nicolas Noble).
4.15 Fri Mar 1 12:04:50 CET 2013
- destroying a non-default loop would stop the global waitpid
diff --git a/libev/LICENSE b/libev/LICENSE
index 777d67c..2fdabd4 100644
--- a/libev/LICENSE
+++ b/libev/LICENSE
@@ -1,5 +1,5 @@
All files in libev are
-Copyright (c)2007,2008,2009,2010,2011,2012 Marc Alexander Lehmann.
+Copyright (c)2007,2008,2009,2010,2011,2012,2013 Marc Alexander Lehmann.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
diff --git a/libev/ev.c b/libev/ev.c
index e5bd5ab..b233e21 100644
--- a/libev/ev.c
+++ b/libev/ev.c
@@ -1,7 +1,7 @@
/*
* libev event processing core, watcher management
*
- * Copyright (c) 2007,2008,2009,2010,2011,2012 Marc Alexander Lehmann <libev at schmorp.de>
+ * Copyright (c) 2007,2008,2009,2010,2011,2012,2013 Marc Alexander Lehmann <libev at schmorp.de>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modifica-
@@ -243,10 +243,7 @@
#elif defined _sys_nsig
# define EV_NSIG (_sys_nsig) /* Solaris 2.5 */
#else
-# error "unable to find value for NSIG, please report"
-/* to make it compile regardless, just remove the above line, */
-/* but consider reporting it, too! :) */
-# define EV_NSIG 65
+# define EV_NSIG (8 * sizeof (sigset_t) + 1)
#endif
#ifndef EV_USE_FLOOR
@@ -254,7 +251,7 @@
#endif
#ifndef EV_USE_CLOCK_SYSCALL
-# if __linux && __GLIBC__ >= 2
+# if __linux && __GLIBC__ == 2 && __GLIBC_MINOR__ < 17
# define EV_USE_CLOCK_SYSCALL EV_FEATURE_OS
# else
# define EV_USE_CLOCK_SYSCALL 0
@@ -487,7 +484,7 @@ struct signalfd_siginfo
/*
* libecb - http://software.schmorp.de/pkg/libecb
*
- * Copyright (©) 2009-2012 Marc Alexander Lehmann <libecb at schmorp.de>
+ * Copyright (©) 2009-2014 Marc Alexander Lehmann <libecb at schmorp.de>
* Copyright (©) 2011 Emanuele Giaquinta
* All rights reserved.
*
@@ -552,8 +549,8 @@ struct signalfd_siginfo
#endif
/* work around x32 idiocy by defining proper macros */
-#if __x86_64 || _M_AMD64
- #if __ILP32
+#if __amd64 || __x86_64 || _M_AMD64 || _M_X64
+ #if _ILP32
#define ECB_AMD64_X32 1
#else
#define ECB_AMD64 1
@@ -575,13 +572,21 @@ struct signalfd_siginfo
#endif
#endif
-#define ECB_C (__STDC__+0) /* this assumes that __STDC__ is either empty or a number */
-#define ECB_C99 (__STDC_VERSION__ >= 199901L)
-#define ECB_C11 (__STDC_VERSION__ >= 201112L)
#define ECB_CPP (__cplusplus+0)
#define ECB_CPP11 (__cplusplus >= 201103L)
#if ECB_CPP
+ #define ECB_C 0
+ #define ECB_STDC_VERSION 0
+#else
+ #define ECB_C 1
+ #define ECB_STDC_VERSION __STDC_VERSION__
+#endif
+
+#define ECB_C99 (ECB_STDC_VERSION >= 199901L)
+#define ECB_C11 (ECB_STDC_VERSION >= 201112L)
+
+#if ECB_CPP
#define ECB_EXTERN_C extern "C"
#define ECB_EXTERN_C_BEG ECB_EXTERN_C {
#define ECB_EXTERN_C_END }
@@ -622,14 +627,18 @@ struct signalfd_siginfo
#elif defined __ARM_ARCH_7__ || defined __ARM_ARCH_7A__ \
|| defined __ARM_ARCH_7M__ || defined __ARM_ARCH_7R__
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("dmb" : : : "memory")
- #elif __sparc || __sparc__
+ #elif __aarch64__
+ #define ECB_MEMORY_FENCE __asm__ __volatile__ ("dmb ish" : : : "memory")
+ #elif (__sparc || __sparc__) && !__sparcv8
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("membar #LoadStore | #LoadLoad | #StoreStore | #StoreLoad" : : : "memory")
#define ECB_MEMORY_FENCE_ACQUIRE __asm__ __volatile__ ("membar #LoadStore | #LoadLoad" : : : "memory")
#define ECB_MEMORY_FENCE_RELEASE __asm__ __volatile__ ("membar #LoadStore | #StoreStore")
#elif defined __s390__ || defined __s390x__
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("bcr 15,0" : : : "memory")
#elif defined __mips__
- #define ECB_MEMORY_FENCE __asm__ __volatile__ ("sync" : : : "memory")
+ /* GNU/Linux emulates sync on mips1 architectures, so we force its use */
+ /* anybody else who still uses mips1 is supposed to send in their version, with detection code. */
+ #define ECB_MEMORY_FENCE __asm__ __volatile__ (".set mips2; sync; .set mips0" : : : "memory")
#elif defined __alpha__
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("mb" : : : "memory")
#elif defined __hppa__
@@ -637,6 +646,12 @@ struct signalfd_siginfo
#define ECB_MEMORY_FENCE_RELEASE __asm__ __volatile__ ("")
#elif defined __ia64__
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("mf" : : : "memory")
+ #elif defined __m68k__
+ #define ECB_MEMORY_FENCE __asm__ __volatile__ ("" : : : "memory")
+ #elif defined __m88k__
+ #define ECB_MEMORY_FENCE __asm__ __volatile__ ("tb1 0,%%r0,128" : : : "memory")
+ #elif defined __sh__
+ #define ECB_MEMORY_FENCE __asm__ __volatile__ ("" : : : "memory")
#endif
#endif
#endif
@@ -645,6 +660,8 @@ struct signalfd_siginfo
#if ECB_GCC_VERSION(4,7)
/* see comment below (stdatomic.h) about the C11 memory model. */
#define ECB_MEMORY_FENCE __atomic_thread_fence (__ATOMIC_SEQ_CST)
+ #define ECB_MEMORY_FENCE_ACQUIRE __atomic_thread_fence (__ATOMIC_ACQUIRE)
+ #define ECB_MEMORY_FENCE_RELEASE __atomic_thread_fence (__ATOMIC_RELEASE)
/* The __has_feature syntax from clang is so misdesigned that we cannot use it
* without risking compile time errors with other compilers. We *could*
@@ -653,10 +670,18 @@ struct signalfd_siginfo
* #elif defined __clang && __has_feature (cxx_atomic)
* // see comment below (stdatomic.h) about the C11 memory model.
* #define ECB_MEMORY_FENCE __c11_atomic_thread_fence (__ATOMIC_SEQ_CST)
+ * #define ECB_MEMORY_FENCE_ACQUIRE __c11_atomic_thread_fence (__ATOMIC_ACQUIRE)
+ * #define ECB_MEMORY_FENCE_RELEASE __c11_atomic_thread_fence (__ATOMIC_RELEASE)
*/
#elif ECB_GCC_VERSION(4,4) || defined __INTEL_COMPILER || defined __clang__
#define ECB_MEMORY_FENCE __sync_synchronize ()
+ #elif _MSC_VER >= 1500 /* VC++ 2008 */
+ /* apparently, microsoft broke all the memory barrier stuff in Visual Studio 2008... */
+ #pragma intrinsic(_ReadBarrier,_WriteBarrier,_ReadWriteBarrier)
+ #define ECB_MEMORY_FENCE _ReadWriteBarrier (); MemoryBarrier()
+ #define ECB_MEMORY_FENCE_ACQUIRE _ReadWriteBarrier (); MemoryBarrier() /* according to msdn, _ReadBarrier is not a load fence */
+ #define ECB_MEMORY_FENCE_RELEASE _WriteBarrier (); MemoryBarrier()
#elif _MSC_VER >= 1400 /* VC++ 2005 */
#pragma intrinsic(_ReadBarrier,_WriteBarrier,_ReadWriteBarrier)
#define ECB_MEMORY_FENCE _ReadWriteBarrier ()
@@ -686,6 +711,8 @@ struct signalfd_siginfo
/* for most usages, or gcc and clang have a bug */
/* I *currently* lean towards the latter, and inefficiently implement */
/* all three of ecb's fences as a seq_cst fence */
+ /* Update, gcc-4.8 generates mfence for all c++ fences, but nothing */
+ /* for all __atomic_thread_fence's except seq_cst */
#define ECB_MEMORY_FENCE atomic_thread_fence (memory_order_seq_cst)
#endif
#endif
@@ -752,6 +779,11 @@ typedef int ecb_bool;
#define ecb_prefetch(addr,rw,locality) __builtin_prefetch (addr, rw, locality)
#else
#define ecb_attribute(attrlist)
+
+ /* possible C11 impl for integral types
+ typedef struct ecb_is_constant_struct ecb_is_constant_struct;
+ #define ecb_is_constant(expr) _Generic ((1 ? (struct ecb_is_constant_struct *)0 : (void *)((expr) - (expr)), ecb_is_constant_struct *: 0, default: 1)) */
+
#define ecb_is_constant(expr) 0
#define ecb_expect(expr,value) (expr)
#define ecb_prefetch(addr,rw,locality)
@@ -1047,22 +1079,57 @@ ecb_inline ecb_bool ecb_little_endian (void) { return ecb_byteorder_helper () ==
|| __i386 || __i386__ \
|| __amd64 || __amd64__ || __x86_64 || __x86_64__ \
|| __powerpc__ || __ppc__ || __powerpc64__ || __ppc64__ \
- || defined __arm__ && defined __ARM_EABI__ \
|| defined __s390__ || defined __s390x__ \
|| defined __mips__ \
|| defined __alpha__ \
|| defined __hppa__ \
|| defined __ia64__ \
- || defined _M_IX86 || defined _M_AMD64 || defined _M_IA64
+ || defined __m68k__ \
+ || defined __m88k__ \
+ || defined __sh__ \
+ || defined _M_IX86 || defined _M_AMD64 || defined _M_IA64 \
+ || (defined __arm__ && (defined __ARM_EABI__ || defined __EABI__ || defined __VFP_FP__ || defined _WIN32_WCE || defined __ANDROID__)) \
+ || defined __aarch64__
#define ECB_STDFP 1
#include <string.h> /* for memcpy */
#else
#define ECB_STDFP 0
- #include <math.h> /* for frexp*, ldexp* */
#endif
#ifndef ECB_NO_LIBM
+ #include <math.h> /* for frexp*, ldexp*, INFINITY, NAN */
+
+ /* only the oldest of old doesn't have this one. solaris. */
+ #ifdef INFINITY
+ #define ECB_INFINITY INFINITY
+ #else
+ #define ECB_INFINITY HUGE_VAL
+ #endif
+
+ #ifdef NAN
+ #define ECB_NAN NAN
+ #else
+ #define ECB_NAN ECB_INFINITY
+ #endif
+
+ /* converts an ieee half/binary16 to a float */
+ ecb_function_ float ecb_binary16_to_float (uint16_t x) ecb_const;
+ ecb_function_ float
+ ecb_binary16_to_float (uint16_t x)
+ {
+ int e = (x >> 10) & 0x1f;
+ int m = x & 0x3ff;
+ float r;
+
+ if (!e ) r = ldexpf (m , -24);
+ else if (e != 31) r = ldexpf (m + 0x400, e - 25);
+ else if (m ) r = ECB_NAN;
+ else r = ECB_INFINITY;
+
+ return x & 0x8000 ? -r : r;
+ }
+
/* convert a float to ieee single/binary32 */
ecb_function_ uint32_t ecb_float_to_binary32 (float x) ecb_const;
ecb_function_ uint32_t
@@ -2106,8 +2173,6 @@ evpipe_init (EV_P)
fd_intern (fds [0]);
}
- fd_intern (fds [1]);
-
evpipe [0] = fds [0];
if (evpipe [1] < 0)
@@ -2123,6 +2188,8 @@ evpipe_init (EV_P)
close (fds [1]);
}
+ fd_intern (evpipe [1]);
+
ev_io_set (&pipe_w, evpipe [0] < 0 ? evpipe [1] : evpipe [0], EV_READ);
ev_io_start (EV_A_ &pipe_w);
ev_unref (EV_A); /* watcher should not keep loop alive */
@@ -2515,13 +2582,13 @@ ev_userdata (EV_P) EV_THROW
}
void
-ev_set_invoke_pending_cb (EV_P_ void (*invoke_pending_cb)(EV_P)) EV_THROW
+ev_set_invoke_pending_cb (EV_P_ ev_loop_callback invoke_pending_cb) EV_THROW
{
invoke_cb = invoke_pending_cb;
}
void
-ev_set_loop_release_cb (EV_P_ void (*release)(EV_P) EV_THROW, void (*acquire)(EV_P) EV_THROW) EV_THROW
+ev_set_loop_release_cb (EV_P_ ev_loop_callback_nothrow release, ev_loop_callback_nothrow acquire) EV_THROW
{
release_cb = release;
acquire_cb = acquire;
diff --git a/libev/ev.h b/libev/ev.h
index c5d582e..38a507e 100644
--- a/libev/ev.h
+++ b/libev/ev.h
@@ -658,8 +658,10 @@ EV_API_DECL void ev_set_timeout_collect_interval (EV_P_ ev_tstamp interval) EV_T
/* advanced stuff for threading etc. support, see docs */
EV_API_DECL void ev_set_userdata (EV_P_ void *data) EV_THROW;
EV_API_DECL void *ev_userdata (EV_P) EV_THROW;
-EV_API_DECL void ev_set_invoke_pending_cb (EV_P_ void (*invoke_pending_cb)(EV_P)) EV_THROW;
-EV_API_DECL void ev_set_loop_release_cb (EV_P_ void (*release)(EV_P), void (*acquire)(EV_P) EV_THROW) EV_THROW;
+typedef void (*ev_loop_callback)(EV_P);
+EV_API_DECL void ev_set_invoke_pending_cb (EV_P_ ev_loop_callback invoke_pending_cb) EV_THROW;
+typedef void (*ev_loop_callback_nothrow)(EV_P) EV_THROW;
+EV_API_DECL void ev_set_loop_release_cb (EV_P_ ev_loop_callback_nothrow release, ev_loop_callback_nothrow acquire) EV_THROW;
EV_API_DECL unsigned int ev_pending_count (EV_P) EV_THROW; /* number of pending events, if any */
EV_API_DECL void ev_invoke_pending (EV_P); /* invoke all pending watchers */
@@ -730,7 +732,7 @@ EV_API_DECL void ev_resume (EV_P) EV_THROW;
#endif
/* stopping (enabling, adding) a watcher does nothing if it is already running */
-/* stopping (disabling, deleting) a watcher does nothing unless its already running */
+/* stopping (disabling, deleting) a watcher does nothing unless it's already running */
#if EV_PROTOTYPES
/* feeds an event into a watcher as if the event actually occurred */
diff --git a/libev/ev.pod b/libev/ev.pod
index 73c4d34..ecbbe38 100644
--- a/libev/ev.pod
+++ b/libev/ev.pod
@@ -1,3 +1,5 @@
+=encoding utf-8
+
=head1 NAME
libev - a high performance full-featured event loop written in C
@@ -398,8 +400,10 @@ If this flag bit is or'ed into the flag value (or the program runs setuid
or setgid) then libev will I<not> look at the environment variable
C<LIBEV_FLAGS>. Otherwise (the default), this environment variable will
override the flags completely if it is found in the environment. This is
-useful to try out specific backends to test their performance, or to work
-around bugs.
+useful to try out specific backends to test their performance, to work
+around bugs, or to make libev threadsafe (accessing environment variables
+cannot be done in a threadsafe way, but usually it works if no other
+thread modifies them).
=item C<EVFLAG_FORKCHECK>
@@ -686,7 +690,7 @@ name, you can call it anytime, but it makes most sense after forking, in
the child process. You I<must> call it (or use C<EVFLAG_FORKCHECK>) in the
child before resuming or calling C<ev_run>.
-Again, you I<have> to call it on I<any> loop that you want to re-use after
+Again, you I<have> to call it on I<any> loop that you want to re-use after
a fork, I<even if you do not plan to use the loop in the parent>. This is
because some kernel interfaces *cough* I<kqueue> *cough* do funny things
during fork.
@@ -2411,9 +2415,9 @@ default loop and for C<SIGIO> in another loop, but you cannot watch for
C<SIGINT> in both the default loop and another loop at the same time. At
the moment, C<SIGCHLD> is permanently tied to the default loop.
-When the first watcher gets started will libev actually register something
-with the kernel (thus it coexists with your own signal handlers as long as
-you don't register any with libev for the same signal).
+Only after the first watcher for a signal is started will libev actually
+register something with the kernel. It thus coexists with your own signal
+handlers as long as you don't register any with libev for the same signal.
If possible and supported, libev will install its handlers with
C<SA_RESTART> (or equivalent) behaviour enabled, so system calls should
@@ -3982,7 +3986,7 @@ you to use some convenience methods to start/stop watchers and also change
the callback model to a model using method callbacks on objects.
To use it,
-
+
#include <ev++.h>
This automatically includes F<ev.h> and puts all of its definitions (many
@@ -5429,7 +5433,7 @@ new API early than late.
=item C<EV_COMPAT3> backwards compatibility mechanism
The backward compatibility mechanism can be controlled by
-C<EV_COMPAT3>. See L</PREPROCESSOR SYMBOLS/MACROS> in the L</EMBEDDING>
+C<EV_COMPAT3>. See L</"PREPROCESSOR SYMBOLS/MACROS"> in the L</EMBEDDING>
section.
=item C<ev_default_destroy> and C<ev_default_fork> have been removed
diff --git a/libev/ev_kqueue.c b/libev/ev_kqueue.c
index 9faf65a..27def23 100644
--- a/libev/ev_kqueue.c
+++ b/libev/ev_kqueue.c
@@ -1,7 +1,7 @@
/*
* libev kqueue backend
*
- * Copyright (c) 2007,2008,2009,2010,2011,2012 Marc Alexander Lehmann <libev at schmorp.de>
+ * Copyright (c) 2007,2008,2009,2010,2011,2012,2013 Marc Alexander Lehmann <libev at schmorp.de>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modifica-
diff --git a/libev/ev_vars.h b/libev/ev_vars.h
index 5fd9c7a..98f7718 100644
--- a/libev/ev_vars.h
+++ b/libev/ev_vars.h
@@ -1,7 +1,7 @@
/*
* loop member variable declarations
*
- * Copyright (c) 2007,2008,2009,2010,2011,2012 Marc Alexander Lehmann <libev at schmorp.de>
+ * Copyright (c) 2007,2008,2009,2010,2011,2012,2013 Marc Alexander Lehmann <libev at schmorp.de>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modifica-
@@ -194,9 +194,9 @@ VARx(unsigned int, loop_count) /* total number of loop iterations/blocks */
VARx(unsigned int, loop_depth) /* #ev_run enters - #ev_run leaves */
VARx(void *, userdata)
-VAR (release_cb, void (*release_cb)(EV_P) EV_THROW)
-VAR (acquire_cb, void (*acquire_cb)(EV_P) EV_THROW)
-VAR (invoke_cb , void (*invoke_cb) (EV_P))
+VAR (release_cb, ev_loop_callback_nothrow release_cb)
+VAR (acquire_cb, ev_loop_callback_nothrow acquire_cb)
+VAR (invoke_cb , ev_loop_callback invoke_cb)
#endif
#undef VARx
diff --git a/libev/ev_win32.c b/libev/ev_win32.c
index 9217af5..d65634c 100644
--- a/libev/ev_win32.c
+++ b/libev/ev_win32.c
@@ -143,7 +143,7 @@ fail:
#undef pipe
#define pipe(filedes) ev_pipe (filedes)
-
+
#define EV_HAVE_EV_TIME 1
ev_tstamp
ev_time (void)
diff --git a/schmorp.h b/schmorp.h
index 2ed1e59..4b3709f 100644
--- a/schmorp.h
+++ b/schmorp.h
@@ -190,7 +190,7 @@ s_get_cv (SV *cb_sv)
dTHX;
HV *st;
GV *gvp;
-
+
return (SV *)sv_2cv (cb_sv, &st, &gvp, 0);
}
@@ -234,7 +234,7 @@ s_gensub (pTHX_ void (*xsub)(pTHX_ CV *), void *arg)
/*****************************************************************************/
/* portable pipe/socketpair */
-#ifdef USE_SOCKETS_AS_HANDLES
+#if defined(USE_SOCKETS_AS_HANDLES) || PERL_VERSION_ATLEAST(5,18,0)
# define S_TO_HANDLE(x) ((HANDLE)win32_get_osfhandle (x))
#else
# define S_TO_HANDLE(x) ((HANDLE)x)
@@ -255,7 +255,7 @@ s_pipe (int filedes [2])
SOCKET listener;
SOCKET sock [2] = { -1, -1 };
- if ((listener = socket (AF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET)
+ if ((listener = socket (AF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET)
return -1;
addr.sin_family = AF_INET;
@@ -271,7 +271,7 @@ s_pipe (int filedes [2])
if (listen (listener, 1))
goto fail;
- if ((sock [0] = socket (AF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET)
+ if ((sock [0] = socket (AF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET)
goto fail;
if (connect (sock [0], (struct sockaddr *)&addr, addr_size))
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libev-perl.git
More information about the Pkg-perl-cvs-commits
mailing list