projects
/
model-checker.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a89a58d
)
threads: add parent info + get_parent() method
author
Brian Norris
<banorris@uci.edu>
Thu, 3 May 2012 21:04:38 +0000
(14:04 -0700)
committer
Brian Norris
<banorris@uci.edu>
Thu, 3 May 2012 21:10:44 +0000
(14:10 -0700)
threads.cc
patch
|
blob
|
history
threads.h
patch
|
blob
|
history
diff --git
a/threads.cc
b/threads.cc
index bc553b140fe4df5a1a2a3e39da7b7b1b91644403..cc939318938170da4712191ab7ea7bd20e78140b 100644
(file)
--- a/
threads.cc
+++ b/
threads.cc
@@
-87,6
+87,7
@@
Thread::Thread(thrd_t *t, void (*func)(), void *a) {
state = THREAD_CREATED;
id = model->get_next_id();
*user_thread = id;
+ parent = thread_current();
}
Thread::~Thread()
diff --git
a/threads.h
b/threads.h
index 38eac0a9cba43bc4107ee02f02eaaf4763b9595a..345f42077a2372510d5922cd31d26420ed274cd7 100644
(file)
--- a/
threads.h
+++ b/
threads.h
@@
-31,8
+31,10
@@
public:
void set_state(thread_state s) { state = s; }
thread_id_t get_id();
thrd_t get_thrd_t() { return *user_thread; }
+ Thread * get_parent() { return parent; }
private:
int create_context();
+ Thread *parent;
void (*start_routine)();
void *arg;