rem: t->next_state = B_THREAD_READY;
context: sem_interrupt_thread(struct thread *t){	int slot;	struct thread_queue wakeup_queue;	TRACE(("sem_interrupt_thread: called on thread %p (%d), blocked on sem 0x%x\n", t, t->id, t->sem_blocking));	if (t->state != B_THREAD_WAITING || t->sem_blocking < 0)		return EINVAL;	if ((t->sem_flags & B_CAN_INTERRUPT) == 0)		return ERR_SEM_NOT_INTERRUPTABLE;	t->next_state = B_THREAD_READY;		slot = t->sem_blocking % MAX_SEMS;	GRAB_SEM_LOCK(gSems[slot]);	if (gSems[slot].id != t->sem_blocking) {		panic("sem_interrupt_thread: thread 0x%lx sez it's blocking on sem 0x%lx, but that sem doesn't exist!\n", t->id, t->sem_blocking);	}	wakeup_queue.head = wakeup_queue.tail = NULL;	if (remove_thread_from_sem(t, &gSems[slot], &wakeup_queue, EINTR) == ERR_NOT_FOUND)		panic("sem_interrupt_thread: thread 0x%lx not found in sem 0x%lx's wait queue\n", t->id, t->sem_blocking);	RELEASE_SEM_LOCK(gSems[slot]);	while ((t = thread_dequeue(&wakeup_queue)) != NULL) {		thread_enqueue_run_q(t);	}	return B_NO_ERROR;}