Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
5e7e11d9
Commit
5e7e11d9
authored
Aug 09, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Win32: vlc_cond_(timed)wait are cancellation points
parent
f442fe0d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
27 deletions
+31
-27
include/vlc_threads.h
include/vlc_threads.h
+31
-27
No files found.
include/vlc_threads.h
View file @
5e7e11d9
...
@@ -393,13 +393,21 @@ static inline void __vlc_cond_wait( const char * psz_file, int i_line,
...
@@ -393,13 +393,21 @@ static inline void __vlc_cond_wait( const char * psz_file, int i_line,
vlc_mutex_lock
(
p_mutex
);
vlc_mutex_lock
(
p_mutex
);
#elif defined( WIN32 )
#elif defined( WIN32 )
(
void
)
psz_file
;
(
void
)
i_line
;
DWORD
result
;
/* Increase our wait count */
do
SignalObjectAndWait
(
*
p_mutex
,
*
p_condvar
,
INFINITE
,
FALSE
);
{
vlc_testcancel
();
result
=
SignalObjectAndWait
(
*
p_mutex
,
*
p_condvar
,
INFINITE
,
TRUE
);
/* Reacquire the mutex before returning. */
/* Reacquire the mutex before returning. */
vlc_mutex_lock
(
p_mutex
);
vlc_mutex_lock
(
p_mutex
);
}
while
(
result
==
WAIT_IO_COMPLETION
);
vlc_testcancel
();
(
void
)
psz_file
;
(
void
)
i_line
;
#elif defined( SYS_BEOS )
#elif defined( SYS_BEOS )
/* The p_condvar->thread var is initialized before the unlock because
/* The p_condvar->thread var is initialized before the unlock because
...
@@ -434,9 +442,9 @@ static inline int __vlc_cond_timedwait( const char * psz_file, int i_line,
...
@@ -434,9 +442,9 @@ static inline int __vlc_cond_timedwait( const char * psz_file, int i_line,
struct
timespec
ts
=
{
d
.
quot
,
d
.
rem
*
1000
};
struct
timespec
ts
=
{
d
.
quot
,
d
.
rem
*
1000
};
int
val
=
pthread_cond_timedwait
(
p_condvar
,
p_mutex
,
&
ts
);
int
val
=
pthread_cond_timedwait
(
p_condvar
,
p_mutex
,
&
ts
);
if
(
val
=
=
ETIMEDOUT
)
if
(
val
!
=
ETIMEDOUT
)
return
ETIMEDOUT
;
/* this error is perfectly normal */
VLC_THREAD_ASSERT
(
"timed-waiting on condition"
);
VLC_THREAD_ASSERT
(
"timed-waiting on condition"
)
;
return
val
;
#elif defined( UNDER_CE )
#elif defined( UNDER_CE )
mtime_t
delay_ms
=
(
deadline
-
mdate
())
/
1000
;
mtime_t
delay_ms
=
(
deadline
-
mdate
())
/
1000
;
...
@@ -450,39 +458,35 @@ static inline int __vlc_cond_timedwait( const char * psz_file, int i_line,
...
@@ -450,39 +458,35 @@ static inline int __vlc_cond_timedwait( const char * psz_file, int i_line,
/* Reacquire the mutex before returning. */
/* Reacquire the mutex before returning. */
vlc_mutex_lock
(
p_mutex
);
vlc_mutex_lock
(
p_mutex
);
if
(
result
==
WAIT_TIMEOUT
)
return
ETIMEDOUT
;
/* this error is perfectly normal */
(
void
)
psz_file
;
(
void
)
i_line
;
(
void
)
psz_file
;
(
void
)
i_line
;
return
(
result
==
WAIT_TIMEOUT
)
?
ETIMEDOUT
:
0
;
#elif defined( WIN32 )
#elif defined( WIN32 )
mtime_t
total
=
(
deadline
-
mdate
())
/
1000
;
mtime_t
total
;
DWORD
result
;
DWORD
result
=
WAIT_TIMEOUT
;
if
(
total
<
0
)
total
=
0
;
do
(
void
)
psz_file
;
(
void
)
i_line
;
vlc_testcancel
();
while
((
total
=
(
deadline
-
mdate
())
>
0
))
{
{
DWORD
delay
=
(
total
>
0x7fffffff
)
?
0x7fffffff
:
total
;
DWORD
delay
=
(
total
>
0x7fffffff
)
?
0x7fffffff
:
total
;
result
=
SignalObjectAndWait
(
*
p_mutex
,
*
p_condvar
,
result
=
SignalObjectAndWait
(
*
p_mutex
,
*
p_condvar
,
delay
,
FALSE
);
delay
,
TRUE
);
total
-=
delay
;
/* Reacquire the mutex before return/cancel. */
vlc_mutex_lock
(
p_mutex
);
vlc_mutex_lock
(
p_mutex
);
if
(
result
==
WAIT_OBJECT_0
)
return
0
;
/* Condition signaled! */
vlc_testcancel
();
}
}
while
(
total
);
return
ETIMEDOUT
;
/* Reacquire the mutex before returning. */
if
(
result
==
WAIT_TIMEOUT
)
return
ETIMEDOUT
;
/* this error is perfectly normal */
(
void
)
psz_file
;
(
void
)
i_line
;
#elif defined( SYS_BEOS )
#elif defined( SYS_BEOS )
# error Unimplemented
# error Unimplemented
#endif
#endif
return
0
;
}
}
/*****************************************************************************
/*****************************************************************************
...
...
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