- // stops the thread if it's running and deletes the wxThread object
- // freeing its memory. This function should also be called if the
- // Create() or Run() fails to free memory (otherwise it will be done by
- // the thread itself when it terminates). The return value is the
- // thread exit code if the thread was gracefully terminated, 0 if it
- // wasn't running and -1 if an error occured.
- ExitCode Delete();
+ // stops the thread if it's running and deletes the wxThread object if
+ // this is a detached thread freeing its memory - otherwise (for
+ // joinable threads) you still need to delete wxThread object
+ // yourself.
+ //
+ // this function only works if the thread calls TestDestroy()
+ // periodically - the thread will only be deleted the next time it
+ // does it!
+ //
+ // will fill the rc pointer with the thread exit code if it's !NULL
+ wxThreadError Delete(ExitCode *rc = (ExitCode *)NULL);
+
+ // waits for a joinable thread to finish and returns its exit code
+ //
+ // Returns (ExitCode)-1 on error (for example, if the thread is not
+ // joinable)
+ ExitCode Wait();