rem: while (!(t = thread_get_thread_struct_locked(slot)) && (t->team->id != tid) && (slot < next_thread_id))
add: while ((slot < next_thread_id) && (!(t = thread_get_thread_struct_locked(slot)) || (t->team->id != tid)))
context: _get_next_thread_info(team_id tid, int32 *cookie, thread_info *info, size_t size){	int state;	int slot;	status_t rc = B_BAD_VALUE;	struct team *team;	struct thread *t = NULL;		if (tid == 0)		tid = team_get_current_team_id();	team = team_get_team_struct(tid);	if (!team)		return B_BAD_VALUE;		state = disable_interrupts();	GRAB_THREAD_LOCK();		if (*cookie == 0)		slot = 0;	else {		slot = *cookie;		if (slot >= next_thread_id)			goto err;	}	while (!(t = thread_get_thread_struct_locked(slot)) && (t->team->id != tid) && (slot < next_thread_id))		slot++;	if (t) {		info->thread = t->id;		info->team = t->team->id;		strncpy(info->name, t->name, B_OS_NAME_LENGTH);		info->name[B_OS_NAME_LENGTH - 1] = '\0';		// XXX- Fix me		info->state = t->state;		info->priority = t->priority;		info->sem = t->sem_blocking;		info->user_time = t->user_time;		info->kernel_time = t->kernel_time;		info->stack_base = (void *)t->user_stack_base;		info->stack_end = (void *)(t->user_stack_base + STACK_SIZE);		slot++;		*cookie = slot;		rc = B_OK;	}err:	RELEASE_THREAD_LOCK();	restore_interrupts(state);		return rc;}