File tree 2 files changed +15
-0
lines changed
2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,15 @@ struct thread *thread__new(pid_t pid, pid_t tid)
80
80
return NULL ;
81
81
}
82
82
83
+ static void (* thread__priv_destructor )(void * priv );
84
+
85
+ void thread__set_priv_destructor (void (* destructor )(void * priv ))
86
+ {
87
+ assert (thread__priv_destructor == NULL );
88
+
89
+ thread__priv_destructor = destructor ;
90
+ }
91
+
83
92
void thread__delete (struct thread * thread )
84
93
{
85
94
struct namespaces * namespaces , * tmp_namespaces ;
@@ -112,6 +121,10 @@ void thread__delete(struct thread *thread)
112
121
exit_rwsem (thread__namespaces_lock (thread ));
113
122
exit_rwsem (thread__comm_lock (thread ));
114
123
thread__free_stitch_list (thread );
124
+
125
+ if (thread__priv_destructor )
126
+ thread__priv_destructor (thread__priv (thread ));
127
+
115
128
RC_CHK_FREE (thread );
116
129
}
117
130
Original file line number Diff line number Diff line change @@ -71,6 +71,8 @@ struct thread *thread__new(pid_t pid, pid_t tid);
71
71
int thread__init_maps (struct thread * thread , struct machine * machine );
72
72
void thread__delete (struct thread * thread );
73
73
74
+ void thread__set_priv_destructor (void (* destructor )(void * priv ));
75
+
74
76
struct thread * thread__get (struct thread * thread );
75
77
void thread__put (struct thread * thread );
76
78
You can’t perform that action at this time.
0 commit comments