Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Gautam Chitnis
web-ui-redesign
Commits
81df45be
Commit
81df45be
authored
Aug 10, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vlc_cond_timedwait: fix unlikely Win32 DWORD overflow
parent
b09d329b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
include/vlc_threads.h
include/vlc_threads.h
+11
-6
No files found.
include/vlc_threads.h
View file @
81df45be
...
...
@@ -386,14 +386,19 @@ static inline int __vlc_cond_timedwait( const char * psz_file, int i_line,
(
void
)
psz_file
;
(
void
)
i_line
;
#elif defined( WIN32 )
mtime_t
delay_ms
=
(
deadline
-
mdate
())
/
1000
;
mtime_t
total
=
(
deadline
-
mdate
())
/
1000
;
DWORD
result
;
if
(
delay_ms
<
0
)
delay_ms
=
0
;
if
(
total
<
0
)
total
=
0
;
/* Increase our wait count */
result
=
SignalObjectAndWait
(
*
p_mutex
,
*
p_condvar
,
delay_ms
,
FALSE
);
do
{
DWORD
delay
=
(
total
>
0x7fffffff
)
?
0x7fffffff
:
total
;
result
=
SignalObjectAndWait
(
*
p_mutex
,
*
p_condvar
,
delay
,
FALSE
);
total
-=
delay
;
}
while
(
total
);
/* Reacquire the mutex before returning. */
vlc_mutex_lock
(
p_mutex
);
...
...
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