[vlc-devel] commit: vlc_join is a cancellation point ( Rémi Denis-Courmont )
git version control
git at videolan.org
Wed Aug 27 22:57:28 CEST 2008
vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Wed Aug 27 20:40:20 2008 +0300| [278a1ccc8ea6c240d431bdb051ea164c4621e4aa] | committer: Rémi Denis-Courmont
vlc_join is a cancellation point
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=278a1ccc8ea6c240d431bdb051ea164c4621e4aa
---
src/misc/threads.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/src/misc/threads.c b/src/misc/threads.c
index 1f358e2..69b9fd4 100644
--- a/src/misc/threads.c
+++ b/src/misc/threads.c
@@ -595,6 +595,9 @@ void vlc_cancel (vlc_thread_t thread_id)
/**
* Waits for a thread to complete (if needed), and destroys it.
+ * This is a cancellation point; in case of cancellation, the join does _not_
+ * occur.
+ *
* @param handle thread handle
* @param p_result [OUT] pointer to write the thread return value or NULL
* @return 0 on success, a standard error code otherwise.
@@ -605,7 +608,11 @@ int vlc_join (vlc_thread_t handle, void **result)
return pthread_join (handle, result);
#elif defined( UNDER_CE ) || defined( WIN32 )
- WaitForSingleObject (handle->handle, INFINITE);
+ do
+ vlc_testcancel ();
+ while (WaitForSingleObjectEx (handle->handle, INFINITE, TRUE)
+ == WAIT_IO_COMPLETION);
+
CloseHandle (handle->handle);
if (result)
*result = handle->data;
More information about the vlc-devel
mailing list