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
dfccdf84
Commit
dfccdf84
authored
Oct 15, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Android: remove polling timer in mwait() and msleep()
parent
22203a58
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
23 deletions
+14
-23
src/android/thread.c
src/android/thread.c
+14
-23
No files found.
src/android/thread.c
View file @
dfccdf84
...
...
@@ -494,34 +494,25 @@ mtime_t mdate (void)
#undef mwait
void
mwait
(
mtime_t
deadline
)
{
deadline
-=
mdate
();
if
(
deadline
>
0
)
msleep
(
deadline
);
vlc_mutex_t
lock
;
vlc_cond_t
wait
;
vlc_mutex_init
(
&
lock
);
vlc_cond_init
(
&
wait
);
vlc_mutex_lock
(
&
lock
);
mutex_cleanup_push
(
&
lock
);
while
(
!
vlc_cond_timedwait
(
&
wait
,
&
lock
,
deadline
));
vlc_cleanup_run
();
vlc_cond_destroy
(
&
wait
);
vlc_mutex_destroy
(
&
lock
);
}
#undef msleep
void
msleep
(
mtime_t
delay
)
{
struct
timespec
ts
=
mtime_to_ts
(
delay
);
vlc_testcancel
();
for
(;;)
{
/* FIXME: drift */
struct
timespec
t
=
{
0
,
10
*
1000
*
1000
};
if
(
ts
.
tv_sec
<=
0
&&
t
.
tv_nsec
>
ts
.
tv_nsec
)
t
.
tv_nsec
=
ts
.
tv_nsec
;
while
(
nanosleep
(
&
t
,
&
t
)
==
-
1
)
{
vlc_testcancel
();
vlc_assert
(
errno
==
EINTR
);
}
ts
.
tv_nsec
-=
10
*
1000
*
1000
;
if
(
ts
.
tv_nsec
<
0
)
{
if
(
--
ts
.
tv_sec
<
0
)
return
;
ts
.
tv_nsec
+=
1000
*
1000
*
1000
;
}
}
mwait
(
mdate
()
+
delay
);
}
/* cpu */
...
...
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