threads: add 'creation' information
authorBrian Norris <banorris@uci.edu>
Tue, 29 May 2012 17:21:06 +0000 (10:21 -0700)
committerBrian Norris <banorris@uci.edu>
Tue, 29 May 2012 21:39:22 +0000 (14:39 -0700)
The 'creation' field will hold the ModelAction that created the thread. For the
main user-thread, this is NULL.

threads.h

index e52c324eb0fb81119d8063625c21387443105b18..7d2189b49d9f098a775b1cc158390cf76f49cbf4 100644 (file)
--- 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;