rem: thread = thread_get_thread_struct_locked(id);
add: thread = thread_get_thread_struct_locked(-id);
context: send_signal_etc(pid_t id, uint signal, uint32 flags){	status_t status = B_BAD_THREAD_ID;	struct thread *thread;	cpu_status state;	if (signal < 1 || signal > MAX_SIGNO)		return B_BAD_VALUE;	if (id == 0) {		// send a signal to the current team		id = thread_get_current_thread()->team->main_thread->id;	}	state = disable_interrupts();	if (id > 0) {		// send a signal to the specified thread		GRAB_THREAD_LOCK();		thread = thread_get_thread_struct_locked(id);		if (thread != NULL)			status = deliver_signal(thread, signal, flags);	} else {		// send a signal to the specified process group		// (the absolute value of the id)		GRAB_THREAD_LOCK();		thread = thread_get_thread_struct_locked(id);		if (thread != NULL) {			struct process_group *group;			struct team *team, *next;			// we need a safe way to get from the thread to the process group			id = thread->team->id;			RELEASE_THREAD_LOCK();			GRAB_TEAM_LOCK();			// get a pointer to the process group			team = team_get_team_struct_locked(id);			group = team->group;			for (team = group->teams; team != NULL; team = next) {				// ToDo: there is a *big* race condition here on SMP machines;				// the team pointer will probably have gone bad in the mean time				next = team->group_next;				id = team->main_thread->id;				RELEASE_TEAM_LOCK();				GRAB_THREAD_LOCK();				thread = thread_get_thread_struct_locked(id);				if (thread != NULL) {					// we don't stop because of an error sending the signal; we					// rather want to send as much signals as possible					status = deliver_signal(thread, signal, flags);				}				RELEASE_THREAD_LOCK();				GRAB_TEAM_LOCK();			}						RELEASE_TEAM_LOCK();			GRAB_THREAD_LOCK();		}	}			// ToDo: maybe the scheduler should only be invoked is there is reason to do it?	//	(ie. deliver_signal() moved some threads in the running queue?)	if ((flags & B_DO_NOT_RESCHEDULE) == 0)		scheduler_reschedule();	RELEASE_THREAD_LOCK();	restore_interrupts(state);	return status;}