aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/thread.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/thread.h')
-rw-r--r--tools/perf/util/thread.h13
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;
37struct thread *thread__new(pid_t pid, pid_t tid); 38struct thread *thread__new(pid_t pid, pid_t tid);
38int thread__init_map_groups(struct thread *thread, struct machine *machine); 39int thread__init_map_groups(struct thread *thread, struct machine *machine);
39void thread__delete(struct thread *thread); 40void thread__delete(struct thread *thread);
41
42struct thread *thread__get(struct thread *thread);
43void thread__put(struct thread *thread);
44
45static 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
40static inline void thread__exited(struct thread *thread) 53static inline void thread__exited(struct thread *thread)
41{ 54{
42 thread->dead = true; 55 thread->dead = true;