rem: if (debuggerPort >= 0) { debug_team_deleted message; message.team = teamID; write_port_etc(debuggerPort, B_DEBUGGER_MESSAGE_TEAM_DELETED, &message, sizeof(message), B_RELATIVE_TIMEOUT, 0);  }
add: user_debug_team_deleted(teamID, debuggerPort);
context: team_delete_team(struct team *team){	// if the team was being debugged, stop that now	team_id teamID = team->id;	port_id debuggerPort		= (team->debug_info.flags & B_TEAM_DEBUG_DEBUGGER_INSTALLED			? team->debug_info.debugger_port : -1);	destroy_team_debug_info(&team->debug_info);	if (team->num_threads > 0) {		// there are other threads still in this team,		// cycle through and signal kill on each of the threads		// ToDo: this can be optimized. There's got to be a better solution.		struct thread *temp_thread;		char death_sem_name[B_OS_NAME_LENGTH];		cpu_status state;		sprintf(death_sem_name, "team %ld death sem", team->id);		team->death_sem = create_sem(0, death_sem_name);		if (team->death_sem < 0)			panic("thread_exit: cannot init death sem for team %ld\n", team->id);		state = disable_interrupts();		GRAB_TEAM_LOCK();		// we can safely walk the list because of the lock. no new threads can be created		// because of the TEAM_STATE_DEATH flag on the team		temp_thread = team->thread_list;		while (temp_thread) {			struct thread *next = temp_thread->team_next;			send_signal_etc(temp_thread->id, SIGKILLTHR, B_DO_NOT_RESCHEDULE);			temp_thread = next;		}		RELEASE_TEAM_LOCK();		restore_interrupts(state);		// wait until all threads in team are dead.		acquire_sem_etc(team->death_sem, team->num_threads, 0, 0);		delete_sem(team->death_sem);	}	// free team resources	vm_delete_aspace(team->aspace);	delete_owned_ports(team->id);	sem_delete_owned_sems(team->id);	remove_images(team);	vfs_free_io_context(team->io_context);	free(team);	// notify the debugger, that the team is gone	if (debuggerPort >= 0) {		debug_team_deleted message;		message.team = teamID;		write_port_etc(debuggerPort, B_DEBUGGER_MESSAGE_TEAM_DELETED, &message,			sizeof(message), B_RELATIVE_TIMEOUT, 0);			// ToDo: Would it be OK to wait here?	}}