diff --git a/headers/private/kernel/thread_types.h b/headers/private/kernel/thread_types.h index 1da7cd5c5d..2fa6b0090e 100644 --- a/headers/private/kernel/thread_types.h +++ b/headers/private/kernel/thread_types.h @@ -96,8 +96,6 @@ struct team_watcher { #define MAX_DEAD_CHILDREN 32 // this is a soft limit for the number of child death entries in a team -#define MAX_DEAD_THREADS 32 - // this is a soft limit for the number of thread death entries in a team struct job_control_entry : DoublyLinkedListLinkImpl { @@ -238,7 +236,6 @@ struct Team : TeamThreadIteratorEntry, KernelReferenceable, struct xsi_sem_context *xsi_sem_context; struct team_death_entry *death_entry; // protected by fLock struct list dead_threads; - int dead_threads_count; // protected by the team's fLock team_dead_children dead_children; diff --git a/src/system/kernel/team.cpp b/src/system/kernel/team.cpp index 8fc10a8087..e791a27c30 100644 --- a/src/system/kernel/team.cpp +++ b/src/system/kernel/team.cpp @@ -470,7 +470,6 @@ Team::Team(team_id id, bool kernel) // dead threads list_init(&dead_threads); - dead_threads_count = 0; // dead children dead_children.count = 0; diff --git a/src/system/kernel/thread.cpp b/src/system/kernel/thread.cpp index b8e6d2ac96..1f10548ff9 100644 --- a/src/system/kernel/thread.cpp +++ b/src/system/kernel/thread.cpp @@ -2139,17 +2139,8 @@ thread_exit(void) threadDeathEntry->thread = thread->id; threadDeathEntry->status = thread->exit.status; - // add entry -- remove an old one, if we hit the limit + // add entry to dead thread list list_add_item(&team->dead_threads, threadDeathEntry); - team->dead_threads_count++; - threadDeathEntry = NULL; - - if (team->dead_threads_count > MAX_DEAD_THREADS) { - threadDeathEntry - = (thread_death_entry*)list_remove_head_item( - &team->dead_threads); - team->dead_threads_count--; - } } threadCreationLocker.Unlock(); @@ -2164,8 +2155,6 @@ thread_exit(void) thread->id)); } - free(threadDeathEntry); - // delete the team if we're its main thread if (deleteTeam) { team_delete_team(team, debuggerPort); @@ -2505,7 +2494,6 @@ wait_for_thread_etc(thread_id id, uint32 flags, bigtime_t timeout, &team->dead_threads, threadDeathEntry)) != NULL) { if (threadDeathEntry->thread == id) { list_remove_item(&team->dead_threads, threadDeathEntry); - team->dead_threads_count--; death.status = threadDeathEntry->status; free(threadDeathEntry); break;