kernel/sys/process.c
/**
 * @brief Signal a semaphore, exceptionally.
 *
 * Wake up everything in the semaphore @p queue but mark every
 * waiter as having been interrupted, rather than gracefully awoken.
 * Generally that means the event they were waiting for did not
 * happen and may never happen.
 *
 * Otherwise, same semantics as @ref wakeup_queue.
 */
@brief Signal a semaphore, exceptionally.
Wake up everything in the semaphore @p queue but mark every
waiter as having been interrupted, rather than gracefully awoken.
Generally that means the event they were waiting for did not
happen and may never happen.

Otherwise, same semantics as @ref wakeup_queue.
@brief Signal a semaphore exceptionally . Wake up everything in the semaphore @p queue but mark every waiter as having been interrupted rather than gracefully awoken . Generally that means the event they were waiting for did not happen and may never happen . Otherwise same semantics as @ref wakeup_queue .
int wakeup_queue_interrupted(list_t * queue) {
	int awoken_processes = 0;
	spin_lock(wait_lock_tmp);
	while (queue->length > 0) {
		node_t * node = list_pop(queue);
		if (!(((process_t *)node->value)->flags & PROC_FLAG_FINISHED)) {
			process_t * proc = node->value;
			__sync_or_and_fetch(&proc->flags, PROC_FLAG_SLEEP_INT);
			make_process_ready(proc);
		}
		awoken_processes++;
	}
	spin_unlock(wait_lock_tmp);
	return awoken_processes;
}
int wakeup_queue_interrupted ( list_t * queue ) { int awoken_processes = 0 ; spin_lock ( wait_lock_tmp ) ; while ( queue -> length > 0 ) { node_t * node = list_pop ( queue ) ; if ( ! ( ( ( process_t * ) node -> value ) -> flags & PROC_FLAG_FINISHED ) ) { process_t * proc = node -> value ; __sync_or_and_fetch ( & proc -> flags , PROC_FLAG_SLEEP_INT ) ; make_process_ready ( proc ) ; } awoken_processes ++ ; } spin_unlock ( wait_lock_tmp ) ; return awoken_processes ; }
@brief Signal a semaphore, exceptionally.
@brief Signal a semaphore exceptionally .