From: Brian Norris Date: Tue, 29 May 2012 17:21:06 +0000 (-0700) Subject: threads: add 'creation' information X-Git-Tag: pldi2013~392^2~7 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=96f9065dff50a8cf382977123deb6bbd98dc78a6;p=model-checker.git threads: add 'creation' information The 'creation' field will hold the ModelAction that created the thread. For the main user-thread, this is NULL. --- diff --git a/threads.h b/threads.h index e52c324..7d2189b 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;