|
@@ -400,7 +400,7 @@ static struct thread *____machine__findnew_thread(struct machine *machine,
|
|
* leader and that would screwed the rb tree.
|
|
* leader and that would screwed the rb tree.
|
|
*/
|
|
*/
|
|
if (thread__init_map_groups(th, machine)) {
|
|
if (thread__init_map_groups(th, machine)) {
|
|
- rb_erase(&th->rb_node, &machine->threads);
|
|
|
|
|
|
+ rb_erase_init(&th->rb_node, &machine->threads);
|
|
RB_CLEAR_NODE(&th->rb_node);
|
|
RB_CLEAR_NODE(&th->rb_node);
|
|
thread__delete(th);
|
|
thread__delete(th);
|
|
return NULL;
|
|
return NULL;
|
|
@@ -1314,7 +1314,7 @@ static void __machine__remove_thread(struct machine *machine, struct thread *th,
|
|
BUG_ON(atomic_read(&th->refcnt) == 0);
|
|
BUG_ON(atomic_read(&th->refcnt) == 0);
|
|
if (lock)
|
|
if (lock)
|
|
pthread_rwlock_wrlock(&machine->threads_lock);
|
|
pthread_rwlock_wrlock(&machine->threads_lock);
|
|
- rb_erase(&th->rb_node, &machine->threads);
|
|
|
|
|
|
+ rb_erase_init(&th->rb_node, &machine->threads);
|
|
RB_CLEAR_NODE(&th->rb_node);
|
|
RB_CLEAR_NODE(&th->rb_node);
|
|
/*
|
|
/*
|
|
* Move it first to the dead_threads list, then drop the reference,
|
|
* Move it first to the dead_threads list, then drop the reference,
|