Thread’s local data
Variables declared within a thread (function) are called local data.
Local (static) data associated with a thread are allocated on the stack. So these may be deallocated when a thread returns.
So don’t plan on using locally declared variables for returning arguments. Plan to pass the arguments thru argument list passed from the caller or initiator of the thread.