[vlc-commits] commit: Fix comments (=?UTF-8?Q?R=C3=A9mi=20Denis=2DCourmont=20?=)
git at videolan.org
git at videolan.org
Sun Dec 5 18:13:23 CET 2010
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Dec 5 19:13:07 2010 +0200| [6a35c6ad8ff6be8ab31c1dcb4da4a833744675c2] | committer: Rémi Denis-Courmont
Fix comments
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6a35c6ad8ff6be8ab31c1dcb4da4a833744675c2
---
src/misc/pthread.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/misc/pthread.c b/src/misc/pthread.c
index 6512c2e..6c1ef93 100644
--- a/src/misc/pthread.c
+++ b/src/misc/pthread.c
@@ -717,13 +717,19 @@ void vlc_join (vlc_thread_t handle, void **result)
* Creates and starts new detached thread.
* A detached thread cannot be joined. Its resources will be automatically
* released whenever the thread exits (in particular, its call stack will be
- * reclaimed). Nevertheless, a detached thread may
- * be cancelled; this can expedite its termination.
+ * reclaimed).
*
* Detached thread are particularly useful when some work needs to be done
* asynchronously, that is likely to be completed much earlier than the thread
* can practically be joined. In this case, thread detach can spare memory.
*
+ * A detached thread may be cancelled, so as to expedite its termination.
+ * Be extremely careful if you do this: while a normal joinable thread can
+ * safely be cancelled after it has already exited, cancelling an already
+ * exited detached thread is undefined: The thread handle would is destroyed
+ * immediately when the detached thread exits. So you need to ensure that the
+ * detached thread is still running before cancellation is attempted.
+ *
* @warning Care must be taken that any resources used by the detached thread
* remains valid until the thread completes.
*
More information about the vlc-commits
mailing list