diff options
Diffstat (limited to 'tools/perf/util/thread.h')
-rw-r--r-- | tools/perf/util/thread.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/perf/util/thread.h b/tools/perf/util/thread.h index 160fd066a7d1..783b6688d2f7 100644 --- a/tools/perf/util/thread.h +++ b/tools/perf/util/thread.h | |||
@@ -20,6 +20,7 @@ struct thread { | |||
20 | pid_t tid; | 20 | pid_t tid; |
21 | pid_t ppid; | 21 | pid_t ppid; |
22 | int cpu; | 22 | int cpu; |
23 | int refcnt; | ||
23 | char shortname[3]; | 24 | char shortname[3]; |
24 | bool comm_set; | 25 | bool comm_set; |
25 | bool dead; /* if set thread has exited */ | 26 | bool dead; /* if set thread has exited */ |
@@ -37,6 +38,18 @@ struct comm; | |||
37 | struct thread *thread__new(pid_t pid, pid_t tid); | 38 | struct thread *thread__new(pid_t pid, pid_t tid); |
38 | int thread__init_map_groups(struct thread *thread, struct machine *machine); | 39 | int thread__init_map_groups(struct thread *thread, struct machine *machine); |
39 | void thread__delete(struct thread *thread); | 40 | void thread__delete(struct thread *thread); |
41 | |||
42 | struct thread *thread__get(struct thread *thread); | ||
43 | void thread__put(struct thread *thread); | ||
44 | |||
45 | static inline void __thread__zput(struct thread **thread) | ||
46 | { | ||
47 | thread__put(*thread); | ||
48 | *thread = NULL; | ||
49 | } | ||
50 | |||
51 | #define thread__zput(thread) __thread__zput(&thread) | ||
52 | |||
40 | static inline void thread__exited(struct thread *thread) | 53 | static inline void thread__exited(struct thread *thread) |
41 | { | 54 | { |
42 | thread->dead = true; | 55 | thread->dead = true; |