Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
a7596108
Commit
a7596108
authored
Jun 30, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input: add vlc_poll_i11e() support for Linux event file descriptor
This saves one file descriptor and some kernel resources.
parent
4fe23efc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
src/misc/interrupt.c
src/misc/interrupt.c
+15
-3
No files found.
src/misc/interrupt.c
View file @
a7596108
...
...
@@ -32,6 +32,9 @@
#ifdef HAVE_POLL
#include <poll.h>
#endif
#ifdef HAVE_SYS_EVENTFD_H
# include <sys/eventfd.h>
#endif
#include <vlc_common.h>
#include <vlc_fs.h>
/* vlc_pipe */
...
...
@@ -256,7 +259,8 @@ static void vlc_poll_i11e_cleanup(void *opaque)
int
*
fd
=
ctx
->
data
;
vlc_interrupt_finish
(
ctx
);
close
(
fd
[
1
]);
if
(
fd
[
1
]
!=
fd
[
0
])
close
(
fd
[
1
]);
close
(
fd
[
0
]);
}
...
...
@@ -269,7 +273,14 @@ static int vlc_poll_i11e_inner(struct pollfd *restrict fds, unsigned nfds,
int
canc
;
/* TODO: cache this */
/* TODO: use eventfd on Linux */
# if defined (HAVE_SYS_EVENTFD_H) && defined (EFD_CLOEXEC)
canc
=
vlc_savecancel
();
fd
[
0
]
=
eventfd
(
0
,
EFD_CLOEXEC
);
vlc_restorecancel
(
canc
);
if
(
fd
[
0
]
!=
-
1
)
fd
[
1
]
=
fd
[
0
];
else
# endif
if
(
vlc_pipe
(
fd
))
{
vlc_testcancel
();
...
...
@@ -314,7 +325,8 @@ static int vlc_poll_i11e_inner(struct pollfd *restrict fds, unsigned nfds,
}
out:
canc
=
vlc_savecancel
();
close
(
fd
[
1
]);
if
(
fd
[
1
]
!=
fd
[
0
])
close
(
fd
[
1
]);
close
(
fd
[
0
]);
vlc_restorecancel
(
canc
);
return
ret
;
...
...
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