From 5b2e99294709899b8e6b0f05b62e062a40688b69 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 16 Dec 2018 00:02:07 +0100 Subject: [PATCH] Document wxThread::Delete() behaviour more precisely Delete() doesn't (and can't, under Unix) wait for the detached threads, although it does do it under MSW (but arguably shouldn't), so it can't retrieve the thread exit code there. Document that its "rc" argument is only useful with joinable threads. Closes #18240. --- interface/wx/thread.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/interface/wx/thread.h b/interface/wx/thread.h index f308327a29..c9ba40baf3 100644 --- a/interface/wx/thread.h +++ b/interface/wx/thread.h @@ -1042,11 +1042,19 @@ public: wxThreadError Create(unsigned int stackSize = 0); /** - Calling Delete() gracefully terminates a @b detached thread, either when - the thread calls TestDestroy() or when it finishes processing. + Calling Delete() requests termination of any thread. + + Note that Delete() doesn't actually stop the thread, but simply asks it + to terminate and so will work only if the thread calls TestDestroy() + periodically. For detached threads, Delete() returns immediately, + without waiting for the thread to actually terminate, while for + joinable threads it does wait for the thread to terminate and may also + return its exit code in @a rc argument. @param rc - The thread exit code, if rc is not NULL. + For joinable threads, filled with the thread exit code on + successful return, if non-@NULL. For detached threads this + parameter is not used. @param waitMode As described in wxThreadWait documentation, wxTHREAD_WAIT_BLOCK