From 4b77d5e1c98f29a70129cf72e02145f68cf220d6 Mon Sep 17 00:00:00 2001
From: Andrew Johnson
The implementation of the epicsThreadMustJoin() functionality
+described below requires facilities that were added to the OS in VxWorks 6.9, so
+that is now the oldest version which this release of EPICS can be built
+against.
epicsThreadCreateOpt() is an alternative to epicsThreadCreate() which @@ -45,8 +52,16 @@ void startitup(void) {
If the new epicsThreadOpts::joinable option flag is set (not the default), -then epicsThreadMustJoin() needs to be called to free up thread resources. -This function will block until the thread main function has returned.
+thenepicsThreadMustJoin() must be called with that
+thread's epicsThreadId when/after the thread exits, to free up thread resources.
+This function will block until the thread's main function has returned, after
+which the epicsThreadId will no longer be valid.
+
+A thread which was created with the joinable flag set may itself call
+epicsThreadMustJoin() passing its own epicsThreadId. This marks the
+thread as no longer being joinable, so it will then free the thread resources
+itself when its main function returns. The epicsThreadId for a thread that is
+not joinable gets invalidated as soon as its main function returns.