Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
78115f09
Commit
78115f09
authored
Jan 20, 2021
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update to libev 4.33. Fixes #1754.
parent
f7b2b6dc
Changes
12
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
504 additions
and
216 deletions
+504
-216
deps/libev/Changes
deps/libev/Changes
+27
-1
deps/libev/configure
deps/libev/configure
+10
-10
deps/libev/ev++.h
deps/libev/ev++.h
+33
-31
deps/libev/ev.3
deps/libev/ev.3
+44
-17
deps/libev/ev.c
deps/libev/ev.c
+192
-31
deps/libev/ev.h
deps/libev/ev.h
+11
-12
deps/libev/ev.pod
deps/libev/ev.pod
+41
-14
deps/libev/ev_iouring.c
deps/libev/ev_iouring.c
+143
-94
deps/libev/ev_linuxaio.c
deps/libev/ev_linuxaio.c
+2
-3
deps/libev/ev_vars.h
deps/libev/ev_vars.h
+0
-1
deps/libev/ev_wrap.h
deps/libev/ev_wrap.h
+0
-2
docs/changes/1754.feature
docs/changes/1754.feature
+1
-0
No files found.
deps/libev/Changes
View file @
78115f09
Revision history for libev, a high-performance and full-featured event loop.
TODO:
revisit 59.x timer in the light of modern powersaving
TODO:
for next ABI/API change, consider moving EV__IOFDSSET into io->fd instead and provide a getter.
TODO: document EV_TSTAMP_T
4.33 Wed Mar 18 13:22:29 CET 2020
- no changes w.r.t. 4.32.
4.32 (EV only)
- the 4.31 timerfd code wrongly changed the priority of the signal
fd watcher, which is usually harmless unless signal fds are
also used (found via cpan tester service).
- the documentation wrongly claimed that user may modify fd and events
members in io watchers when the watcher was stopped
(found by b_jonas).
- new ev_io_modify mutator which changes only the events member,
which can be faster. also added ev::io::set (int events) method
to ev++.h.
- officially allow a zero events mask for io watchers. this should
work with older libev versions as well but was not officially
allowed before.
- do not wake up every minute when timerfd is used to detect timejumps.
- do not wake up every minute when periodics are disabled and we have
a monotonic clock.
- support a lot more "uncommon" compile time configurations,
such as ev_embed enabled but ev_timer disabled.
- use a start/stop wrapper class to reduce code duplication in
ev++.h and make it needlessly more c++-y.
- the linux aio backend is no longer compiled in by default.
- update to libecb version 0x00010008.
4.31 Fri Dec 20 21:58:29 CET 2019
- handle backends with minimum wait time a bit better by not
waiting in the presence of already-expired timers
...
...
deps/libev/configure
View file @
78115f09
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for libev 4.3
1
.
# Generated by GNU Autoconf 2.69 for libev 4.3
3
.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
...
...
@@ -587,8 +587,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME
=
'libev'
PACKAGE_TARNAME
=
'libev'
PACKAGE_VERSION
=
'4.3
1
'
PACKAGE_STRING
=
'libev 4.3
1
'
PACKAGE_VERSION
=
'4.3
3
'
PACKAGE_STRING
=
'libev 4.3
3
'
PACKAGE_BUGREPORT
=
''
PACKAGE_URL
=
''
...
...
@@ -1325,7 +1325,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat
<<
_ACEOF
\`
configure' configures libev 4.3
1
to adapt to many kinds of systems.
\`
configure' configures libev 4.3
3
to adapt to many kinds of systems.
Usage:
$0
[OPTION]... [VAR=VALUE]...
...
...
@@ -1396,7 +1396,7 @@ fi
if
test
-n
"
$ac_init_help
"
;
then
case
$ac_init_help
in
short
|
recursive
)
echo
"Configuration of libev 4.3
1
:"
;;
short
|
recursive
)
echo
"Configuration of libev 4.3
3
:"
;;
esac
cat
<<
\
_ACEOF
...
...
@@ -1509,7 +1509,7 @@ fi
test
-n
"
$ac_init_help
"
&&
exit
$ac_status
if
$ac_init_version
;
then
cat
<<
\
_ACEOF
libev configure 4.3
1
libev configure 4.3
3
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
...
...
@@ -1928,7 +1928,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by libev
$as_me
4.3
1
, which was
It was created by libev
$as_me
4.3
3
, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0
$@
...
...
@@ -2795,7 +2795,7 @@ fi
# Define the identity of the package.
PACKAGE
=
'libev'
VERSION
=
'4.3
1
'
VERSION
=
'4.3
3
'
cat
>>
confdefs.h
<<
_ACEOF
...
...
@@ -12871,7 +12871,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by libev
$as_me
4.3
1
, which was
This file was extended by libev
$as_me
4.3
3
, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES =
$CONFIG_FILES
...
...
@@ -12937,7 +12937,7 @@ _ACEOF
cat
>>
$CONFIG_STATUS
<<
_ACEOF
|| ac_write_fail=1
ac_cs_config="`
$as_echo
"
$ac_configure_args
" | sed 's/^ //; s/[
\\
""
\`\$
]/
\\\\
&/g'`"
ac_cs_version="
\\
libev config.status 4.3
1
libev config.status 4.3
3
configured by
$0
, generated by GNU Autoconf 2.69,
with options
\\
"
\$
ac_cs_config
\\
"
...
...
deps/libev/ev++.h
View file @
78115f09
/*
* libev simple C++ wrapper classes
*
* Copyright (c) 2007,2008,2010,2018 Marc Alexander Lehmann <libev@schmorp.de>
* Copyright (c) 2007,2008,2010,2018
,2020
Marc Alexander Lehmann <libev@schmorp.de>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modifica-
...
...
@@ -421,6 +421,24 @@ namespace ev {
template
<
class
ev_watcher
,
class
watcher
>
struct
base
:
ev_watcher
{
// scoped pause/unpause of a watcher
struct
freeze_guard
{
watcher
&
w
;
bool
active
;
freeze_guard
(
watcher
*
self
)
EV_NOEXCEPT
:
w
(
*
self
),
active
(
w
.
is_active
())
{
if
(
active
)
w
.
stop
();
}
~
freeze_guard
()
{
if
(
active
)
w
.
start
();
}
};
#if EV_MULTIPLICITY
EV_PX
;
...
...
@@ -614,18 +632,14 @@ namespace ev {
EV_BEGIN_WATCHER
(
io
,
io
)
void
set
(
int
fd
,
int
events
)
EV_NOEXCEPT
{
int
active
=
is_active
();
if
(
active
)
stop
();
freeze_guard
freeze
(
this
);
ev_io_set
(
static_cast
<
ev_io
*>
(
this
),
fd
,
events
);
if
(
active
)
start
();
}
void
set
(
int
events
)
EV_NOEXCEPT
{
int
active
=
is_active
();
if
(
active
)
stop
();
ev_io_set
(
static_cast
<
ev_io
*>
(
this
),
fd
,
events
);
if
(
active
)
start
();
freeze_guard
freeze
(
this
);
ev_io_modify
(
static_cast
<
ev_io
*>
(
this
),
events
);
}
void
start
(
int
fd
,
int
events
)
EV_NOEXCEPT
...
...
@@ -638,10 +652,8 @@ namespace ev {
EV_BEGIN_WATCHER
(
timer
,
timer
)
void
set
(
ev_tstamp
after
,
ev_tstamp
repeat
=
0.
)
EV_NOEXCEPT
{
int
active
=
is_active
();
if
(
active
)
stop
();
freeze_guard
freeze
(
this
);
ev_timer_set
(
static_cast
<
ev_timer
*>
(
this
),
after
,
repeat
);
if
(
active
)
start
();
}
void
start
(
ev_tstamp
after
,
ev_tstamp
repeat
=
0.
)
EV_NOEXCEPT
...
...
@@ -665,10 +677,8 @@ namespace ev {
EV_BEGIN_WATCHER
(
periodic
,
periodic
)
void
set
(
ev_tstamp
at
,
ev_tstamp
interval
=
0.
)
EV_NOEXCEPT
{
int
active
=
is_active
();
if
(
active
)
stop
();
freeze_guard
freeze
(
this
);
ev_periodic_set
(
static_cast
<
ev_periodic
*>
(
this
),
at
,
interval
,
0
);
if
(
active
)
start
();
}
void
start
(
ev_tstamp
at
,
ev_tstamp
interval
=
0.
)
EV_NOEXCEPT
...
...
@@ -688,10 +698,8 @@ namespace ev {
EV_BEGIN_WATCHER
(
sig
,
signal
)
void
set
(
int
signum
)
EV_NOEXCEPT
{
int
active
=
is_active
();
if
(
active
)
stop
();
freeze_guard
freeze
(
this
);
ev_signal_set
(
static_cast
<
ev_signal
*>
(
this
),
signum
);
if
(
active
)
start
();
}
void
start
(
int
signum
)
EV_NOEXCEPT
...
...
@@ -706,10 +714,8 @@ namespace ev {
EV_BEGIN_WATCHER
(
child
,
child
)
void
set
(
int
pid
,
int
trace
=
0
)
EV_NOEXCEPT
{
int
active
=
is_active
();
if
(
active
)
stop
();
freeze_guard
freeze
(
this
);
ev_child_set
(
static_cast
<
ev_child
*>
(
this
),
pid
,
trace
);
if
(
active
)
start
();
}
void
start
(
int
pid
,
int
trace
=
0
)
EV_NOEXCEPT
...
...
@@ -724,10 +730,8 @@ namespace ev {
EV_BEGIN_WATCHER
(
stat
,
stat
)
void
set
(
const
char
*
path
,
ev_tstamp
interval
=
0.
)
EV_NOEXCEPT
{
int
active
=
is_active
();
if
(
active
)
stop
();
freeze_guard
freeze
(
this
);
ev_stat_set
(
static_cast
<
ev_stat
*>
(
this
),
path
,
interval
);
if
(
active
)
start
();
}
void
start
(
const
char
*
path
,
ev_tstamp
interval
=
0.
)
EV_NOEXCEPT
...
...
@@ -766,10 +770,8 @@ namespace ev {
EV_BEGIN_WATCHER
(
embed
,
embed
)
void
set_embed
(
struct
ev_loop
*
embedded_loop
)
EV_NOEXCEPT
{
int
active
=
is_active
();
if
(
active
)
stop
();
freeze_guard
freeze
(
this
);
ev_embed_set
(
static_cast
<
ev_embed
*>
(
this
),
embedded_loop
);
if
(
active
)
start
();
}
void
start
(
struct
ev_loop
*
embedded_loop
)
EV_NOEXCEPT
...
...
deps/libev/ev.3
View file @
78115f09
...
...
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "LIBEV 3"
.TH LIBEV 3 "20
19-12-21
" "libev-4.31" "libev - high performance full featured event loop"
.TH LIBEV 3 "20
20-03-12
" "libev-4.31" "libev - high performance full featured event loop"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
...
...
@@ -1351,8 +1351,9 @@ with a watcher-specific start function (\f(CW\*(C`ev_TYPE_start (loop, watcher
corresponding stop function (\f(CW\*(C`ev_TYPE_stop (loop, watcher *)\*(C'\fR.
.PP
As long as your watcher is active (has been started but not stopped) you
must not touch the values stored in it. Most specifically you must never
reinitialise it or call its \f(CW\*(C`ev_TYPE_set\*(C'\fR macro.
must not touch the values stored in it except when explicitly documented
otherwise. Most specifically you must never reinitialise it or call its
\&\f(CW\*(C`ev_TYPE_set\*(C'\fR macro.
.PP
Each and every callback receives the event loop pointer as first, the
registered watcher structure as second, and a bitset of received events as
...
...
@@ -1769,14 +1770,18 @@ This section describes each watcher in detail, but will not repeat
information given in the last section. Any initialisation/set macros,
functions and members specific to the watcher type are explained.
.PP
Members are additionally marked with either \fI[read\-only]\fR, meaning that,
while the watcher is active, you can look at the member and expect some
sensible content, but you must not modify it (you can modify it while the
watcher is stopped to your hearts content), or \fI[read\-write]\fR, which
means you can expect it to have some sensible content while the watcher
is active, but you can also modify it. Modifying it may not do something
Most members are additionally marked with either \fI[read\-only]\fR, meaning
that, while the watcher is active, you can look at the member and expect
some sensible content, but you must not modify it (you can modify it while
the watcher is stopped to your hearts content), or \fI[read\-write]\fR, which
means you can expect it to have some sensible content while the watcher is
active, but you can also modify it (within the same thread as the event
loop, i.e. without creating data races). Modifying it may not do something
sensible or take immediate effect (or do anything at all), but libev will
not crash or malfunction in any way.
.PP
In any case, the documentation for each member will explain what the
effects are, and if there are any additional access restrictions.
.ie n .SS """ev_io"" \- is this file descriptor readable or writable?"
.el .SS "\f(CWev_io\fP \- is this file descriptor readable or writable?"
.IX Subsection "ev_io - is this file descriptor readable or writable?"
...
...
@@ -1952,14 +1957,33 @@ opportunity for a DoS attack.
.IX Item "ev_io_set (ev_io *, int fd, int events)"
.PD
Configures an \f(CW\*(C`ev_io\*(C'\fR watcher. The \f(CW\*(C`fd\*(C'\fR is the file descriptor to
receive events for and \f(CW\*(C`events\*(C'\fR is either \f(CW\*(C`EV_READ\*(C'\fR, \f(CW\*(C`EV_WRITE\*(C'\fR or
\&\f(CW\*(C`EV_READ | EV_WRITE\*(C'\fR, to express the desire to receive the given events.
.IP "int fd [read\-only]" 4
.IX Item "int fd [read-only]"
The file descriptor being watched.
.IP "int events [read\-only]" 4
.IX Item "int events [read-only]"
The events being watched.
receive events for and \f(CW\*(C`events\*(C'\fR is either \f(CW\*(C`EV_READ\*(C'\fR, \f(CW\*(C`EV_WRITE\*(C'\fR, both
\&\f(CW\*(C`EV_READ | EV_WRITE\*(C'\fR or \f(CW0\fR, to express the desire to receive the given
events.
.Sp
Note that setting the \f(CW\*(C`events\*(C'\fR to \f(CW0\fR and starting the watcher is
supported, but not specially optimized \- if your program sometimes happens
to generate this combination this is fine, but if it is easy to avoid
starting an io watcher watching for no events you should do so.
.IP "ev_io_modify (ev_io *, int events)" 4
.IX Item "ev_io_modify (ev_io *, int events)"
Similar to \f(CW\*(C`ev_io_set\*(C'\fR, but only changes the requested events. Using this
might be faster with some backends, as libev can assume that the \f(CW\*(C`fd\*(C'\fR
still refers to the same underlying file description, something it cannot
do when using \f(CW\*(C`ev_io_set\*(C'\fR.
.IP "int fd [no\-modify]" 4
.IX Item "int fd [no-modify]"
The file descriptor being watched. While it can be read at any time, you
must not modify this member even when the watcher is stopped \- always use
\&\f(CW\*(C`ev_io_set\*(C'\fR for that.
.IP "int events [no\-modify]" 4
.IX Item "int events [no-modify]"
The set of events the fd is being watched for, among other flags. Remember
that this is a bit set \- to test for \f(CW\*(C`EV_READ\*(C'\fR, use \f(CW\*(C`w\->events &
EV_READ\*(C'\fR, and similarly for \f(CW\*(C`EV_WRITE\*(C'\fR.
.Sp
As with \f(CW\*(C`fd\*(C'\fR, you must not modify this member even when the watcher is
stopped, always use \f(CW\*(C`ev_io_set\*(C'\fR or \f(CW\*(C`ev_io_modify\*(C'\fR for that.
.PP
\fIExamples\fR
.IX Subsection "Examples"
...
...
@@ -4397,6 +4421,9 @@ method.
.Sp
For \f(CW\*(C`ev::embed\*(C'\fR watchers this method is called \f(CW\*(C`set_embed\*(C'\fR, to avoid
clashing with the \f(CW\*(C`set (loop)\*(C'\fR method.
.Sp
For \f(CW\*(C`ev::io\*(C'\fR watchers there is an additional \f(CW\*(C`set\*(C'\fR method that acepts a
new event mask only, and internally calls \f(CW\*(C`ev_io_modfify\*(C'\fR.
.IP "w\->start ()" 4
.IX Item "w->start ()"
Starts the watcher. Note that there is no \f(CW\*(C`loop\*(C'\fR argument, as the
...
...
deps/libev/ev.c
View file @
78115f09
This diff is collapsed.
Click to expand it.
deps/libev/ev.h
View file @
78115f09
/*
* libev native API header
*
* Copyright (c) 2007-20
19
Marc Alexander Lehmann <libev@schmorp.de>
* Copyright (c) 2007-20
20
Marc Alexander Lehmann <libev@schmorp.de>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modifica-
...
...
@@ -215,7 +215,7 @@ struct ev_loop;
/*****************************************************************************/
#define EV_VERSION_MAJOR 4
#define EV_VERSION_MINOR 3
1
#define EV_VERSION_MINOR 3
3
/* eventmask, revents, events... */
enum
{
...
...
@@ -392,14 +392,12 @@ typedef struct ev_stat
}
ev_stat
;
#endif
#if EV_IDLE_ENABLE
/* invoked when the nothing else needs to be done, keeps the process from blocking */
/* revent EV_IDLE */
typedef
struct
ev_idle
{
EV_WATCHER
(
ev_idle
)
}
ev_idle
;
#endif
/* invoked for each run of the mainloop, just before the blocking call */
/* you can still change events in any way you like */
...
...
@@ -416,23 +414,19 @@ typedef struct ev_check
EV_WATCHER
(
ev_check
)
}
ev_check
;
#if EV_FORK_ENABLE
/* the callback gets invoked before check in the child process when a fork was detected */
/* revent EV_FORK */
typedef
struct
ev_fork
{
EV_WATCHER
(
ev_fork
)
}
ev_fork
;
#endif
#if EV_CLEANUP_ENABLE
/* is invoked just before the loop gets destroyed */
/* revent EV_CLEANUP */
typedef
struct
ev_cleanup
{
EV_WATCHER
(
ev_cleanup
)
}
ev_cleanup
;
#endif
#if EV_EMBED_ENABLE
/* used to embed an event loop inside another */
...
...
@@ -442,16 +436,18 @@ typedef struct ev_embed
EV_WATCHER
(
ev_embed
)
struct
ev_loop
*
other
;
/* ro */
#undef EV_IO_ENABLE
#define EV_IO_ENABLE 1
ev_io
io
;
/* private */
#undef EV_PREPARE_ENABLE
#define EV_PREPARE_ENABLE 1
ev_prepare
prepare
;
/* private */
ev_check
check
;
/* unused */
ev_timer
timer
;
/* unused */
ev_periodic
periodic
;
/* unused */
ev_idle
idle
;
/* unused */
ev_fork
fork
;
/* private */
#if EV_CLEANUP_ENABLE
ev_cleanup
cleanup
;
/* unused */
#endif
}
ev_embed
;
#endif
...
...
@@ -526,7 +522,7 @@ enum {
EVBACKEND_KQUEUE
=
0x00000008U
,
/* bsd, broken on osx */
EVBACKEND_DEVPOLL
=
0x00000010U
,
/* solaris 8 */
/* NYI */
EVBACKEND_PORT
=
0x00000020U
,
/* solaris 10 */
EVBACKEND_LINUXAIO
=
0x00000040U
,
/* linu
i
x AIO, 4.19+ */
EVBACKEND_LINUXAIO
=
0x00000040U
,
/* linux AIO, 4.19+ */
EVBACKEND_IOURING
=
0x00000080U
,
/* linux io_uring, 5.1+ */
EVBACKEND_ALL
=
0x000000FFU
,
/* all known backends */
EVBACKEND_MASK
=
0x0000FFFFU
/* all future backends */
...
...
@@ -660,6 +656,8 @@ EV_API_DECL void ev_unref (EV_P) EV_NOEXCEPT;
*/
EV_API_DECL
void
ev_once
(
EV_P_
int
fd
,
int
events
,
ev_tstamp
timeout
,
void
(
*
cb
)(
int
revents
,
void
*
arg
),
void
*
arg
)
EV_NOEXCEPT
;
EV_API_DECL
void
ev_invoke_pending
(
EV_P
);
/* invoke all pending watchers */
# if EV_FEATURE_API
EV_API_DECL
unsigned
int
ev_iteration
(
EV_P
)
EV_NOEXCEPT
;
/* number of loop iterations */
EV_API_DECL
unsigned
int
ev_depth
(
EV_P
)
EV_NOEXCEPT
;
/* #ev_loop enters - #ev_loop leaves */
...
...
@@ -677,7 +675,6 @@ EV_API_DECL void ev_set_invoke_pending_cb (EV_P_ ev_loop_callback invoke_pending
EV_API_DECL
void
ev_set_loop_release_cb
(
EV_P_
void
(
*
release
)(
EV_P
)
EV_NOEXCEPT
,
void
(
*
acquire
)(
EV_P
)
EV_NOEXCEPT
)
EV_NOEXCEPT
;
EV_API_DECL
unsigned
int
ev_pending_count
(
EV_P
)
EV_NOEXCEPT
;
/* number of pending events, if any */
EV_API_DECL
void
ev_invoke_pending
(
EV_P
);
/* invoke all pending watchers */
/*
* stop/start the timer handling.
...
...
@@ -697,6 +694,7 @@ EV_API_DECL void ev_resume (EV_P) EV_NOEXCEPT;
ev_set_cb ((ev), cb_); \
} while (0)
#define ev_io_modify(ev,events_) do { (ev)->events = (ev)->events & EV__IOFDSET | (events_); } while (0)
#define ev_io_set(ev,fd_,events_) do { (ev)->fd = (fd_); (ev)->events = (events_) | EV__IOFDSET; } while (0)
#define ev_timer_set(ev,after_,repeat_) do { ((ev_watcher_time *)(ev))->at = (after_); (ev)->repeat = (repeat_); } while (0)
#define ev_periodic_set(ev,ofs_,ival_,rcb_) do { (ev)->offset = (ofs_); (ev)->interval = (ival_); (ev)->reschedule_cb = (rcb_); } while (0)
...
...
@@ -742,6 +740,7 @@ EV_API_DECL void ev_resume (EV_P) EV_NOEXCEPT;
#define ev_periodic_at(ev) (+((ev_watcher_time *)(ev))->at)
#ifndef ev_set_cb
/* memmove is used here to avoid strict aliasing violations, and hopefully is optimized out by any reasonable compiler */
# define ev_set_cb(ev,cb_) (ev_cb_ (ev) = (cb_), memmove (&((ev_watcher *)(ev))->cb, &ev_cb_ (ev), sizeof (ev_cb_ (ev))))
#endif
...
...
deps/libev/ev.pod
View file @
78115f09
...
...
@@ -1220,8 +1220,9 @@ with a watcher-specific start function (C<< ev_TYPE_start (loop, watcher
corresponding stop function (C<< ev_TYPE_stop (loop, watcher *) >>.
As long as your watcher is active (has been started but not stopped) you
must not touch the values stored in it. Most specifically you must never
reinitialise it or call its C<ev_TYPE_set> macro.
must not touch the values stored in it except when explicitly documented
otherwise. Most specifically you must never reinitialise it or call its
C<ev_TYPE_set> macro.
Each and every callback receives the event loop pointer as first, the
registered watcher structure as second, and a bitset of received events as
...
...
@@ -1650,15 +1651,18 @@ This section describes each watcher in detail, but will not repeat
information given in the last section. Any initialisation/set macros,
functions and members specific to the watcher type are explained.
Members are additionally marked with either I<[read-only]>, meaning that,
while the watcher is active, you can look at the member and expect some
sensible content, but you must not modify it (you can modify it while the
watcher is stopped to your hearts content), or I<[read-write]>, which
means you can expect it to have some sensible content while the watcher
is active, but you can also modify it. Modifying it may not do something
Most members are additionally marked with either I<[read-only]>, meaning
that, while the watcher is active, you can look at the member and expect
some sensible content, but you must not modify it (you can modify it while
the watcher is stopped to your hearts content), or I<[read-write]>, which
means you can expect it to have some sensible content while the watcher is
active, but you can also modify it (within the same thread as the event
loop, i.e. without creating data races). Modifying it may not do something
sensible or take immediate effect (or do anything at all), but libev will
not crash or malfunction in any way.
In any case, the documentation for each member will explain what the
effects are, and if there are any additional access restrictions.
=head2 C<ev_io> - is this file descriptor readable or writable?
...
...
@@ -1828,16 +1832,36 @@ opportunity for a DoS attack.
=item ev_io_set (ev_io *, int fd, int events)
Configures an C<ev_io> watcher. The C<fd> is the file descriptor to
receive events for and C<events> is either C<EV_READ>, C<EV_WRITE> or
C<EV_READ | EV_WRITE>, to express the desire to receive the given events.
receive events for and C<events> is either C<EV_READ>, C<EV_WRITE>, both
C<EV_READ | EV_WRITE> or C<0>, to express the desire to receive the given
events.
=item int fd [read-only]
Note that setting the C<events> to C<0> and starting the watcher is
supported, but not specially optimized - if your program sometimes happens
to generate this combination this is fine, but if it is easy to avoid
starting an io watcher watching for no events you should do so.
The file descriptor being watched.
=item ev_io_modify (ev_io *, int events)
=item int events [read-only]
Similar to C<ev_io_set>, but only changes the requested events. Using this
might be faster with some backends, as libev can assume that the C<fd>
still refers to the same underlying file description, something it cannot
do when using C<ev_io_set>.
The events being watched.
=item int fd [no-modify]
The file descriptor being watched. While it can be read at any time, you
must not modify this member even when the watcher is stopped - always use
C<ev_io_set> for that.
=item int events [no-modify]
The set of events the fd is being watched for, among other flags. Remember
that this is a bit set - to test for C<EV_READ>, use C<< w->events &
EV_READ >>, and similarly for C<EV_WRITE>.
As with C<fd>, you must not modify this member even when the watcher is
stopped, always use C<ev_io_set> or C<ev_io_modify> for that.
=back
...
...
@@ -4245,6 +4269,9 @@ method.
For C<ev::embed> watchers this method is called C<set_embed>, to avoid
clashing with the C<set (loop)> method.
For C<ev::io> watchers there is an additional C<set> method that acepts a
new event mask only, and internally calls C<ev_io_modfify>.
=item w->start ()
Starts the watcher. Note that there is no C<loop> argument, as the
...
...
deps/libev/ev_iouring.c
View file @
78115f09
This diff is collapsed.
Click to expand it.
deps/libev/ev_linuxaio.c
View file @
78115f09
...
...
@@ -270,8 +270,7 @@ linuxaio_modify (EV_P_ int fd, int oev, int nev)
++
anfd
->
egen
;
}
iocb
->
io
.
aio_buf
=
(
nev
&
EV_READ
?
POLLIN
:
0
)
iocb
->
io
.
aio_buf
=
(
nev
&
EV_READ
?
POLLIN
:
0
)
|
(
nev
&
EV_WRITE
?
POLLOUT
:
0
);
if
(
nev
)
...
...
deps/libev/ev_vars.h
View file @
78115f09
...
...
@@ -145,7 +145,6 @@ VARx(uint32_t, iouring_cq_cqes)
VARx
(
ev_tstamp
,
iouring_tfd_to
)
VARx
(
int
,
iouring_tfd
)
VARx
(
ev_io
,
iouring_tfd_w
)
VARx
(
ev_io
,
iouring_epoll_w
)
#endif
#if EV_USE_KQUEUE || EV_GENWRAP
...
...
deps/libev/ev_wrap.h
View file @
78115f09
...
...
@@ -53,7 +53,6 @@
#define iouring_cq_ring_size ((loop)->iouring_cq_ring_size)
#define iouring_cq_tail ((loop)->iouring_cq_tail)
#define iouring_entries ((loop)->iouring_entries)
#define iouring_epoll_w ((loop)->iouring_epoll_w)
#define iouring_fd ((loop)->iouring_fd)
#define iouring_max_entries ((loop)->iouring_max_entries)
#define iouring_sq_array ((loop)->iouring_sq_array)
...
...
@@ -189,7 +188,6 @@
#undef iouring_cq_ring_size
#undef iouring_cq_tail
#undef iouring_entries
#undef iouring_epoll_w
#undef iouring_fd
#undef iouring_max_entries
#undef iouring_sq_array
...
...
docs/changes/1754.feature
0 → 100644
View file @
78115f09
Update
the
embedded
libev
from
4.31
to
4.33.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment