From 96f9065dff50a8cf382977123deb6bbd98dc78a6 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Tue, 29 May 2012 10:21:06 -0700 Subject: [PATCH] threads: add 'creation' information The 'creation' field will hold the ModelAction that created the thread. For the main user-thread, this is NULL. --- threads.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/threads.h b/threads.h index e52c324e..7d2189b4 100644 --- a/threads.h +++ b/threads.h @@ -16,6 +16,8 @@ typedef enum thread_state { THREAD_COMPLETED } thread_state; +class ModelAction; + class Thread { public: Thread(thrd_t *t, void (*func)(void *), void *a); @@ -31,12 +33,16 @@ public: thrd_t get_thrd_t() { return *user_thread; } Thread * get_parent() { return parent; } + void set_creation(ModelAction *act) { creation = act; } + ModelAction * get_creation() { return creation; } + friend void thread_startup(); SNAPSHOTALLOC private: int create_context(); Thread *parent; + ModelAction *creation; void (*start_routine)(void *); void *arg; -- 2.34.1