Add a field to posix_thread to keep track of its parent. This is
populated during the creation of a posix_thread, and it is used
for deriving the parent's state in execve() / exit().
Signed-off-by: Michalis Pappas <michalis@unikraft.io>
Approved-by: Andrei Tatar <andrei@unikraft.io>
Reviewed-by: Sergiu Moga <sergiu@unikraft.io>
Reviewed-by: Andrei Tatar <andrei@unikraft.io>
GitHub-Closes: #1386
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
+
#include <uk/config.h>
#include <sys/types.h>
#include <stddef.h>
pprocess_release(orig_pprocess);
}
+ (*pthread)->parent = parent_pthread;
+
pprocess->parent = parent_pprocess;
if (parent_pprocess) {
uk_list_add_tail(&pprocess->child_list_entry,
struct posix_thread {
pid_t tid;
struct posix_process *process;
+ struct posix_thread *parent;
struct uk_list_head thread_list_entry;
struct uk_thread *thread;
struct uk_alloc *_a;