Subversion Repositories shark

Compare Revisions

Regard whitespace Rev 28 → Rev 29

/shark/trunk/kernel/signal.c
18,11 → 18,11
 
/**
------------
CVS : $Id: signal.c,v 1.1.1.1 2002-03-29 14:12:52 pj Exp $
CVS : $Id: signal.c,v 1.2 2002-11-11 08:34:09 pj Exp $
 
File: $File$
Revision: $Revision: 1.1.1.1 $
Last update: $Date: 2002-03-29 14:12:52 $
Revision: $Revision: 1.2 $
Last update: $Date: 2002-11-11 08:34:09 $
------------
 
This file contains:
108,7 → 108,7
* A queue of all threads waiting in sigwait.
* It is not static because it is used into the task_kill...ð
*/
static QUEUE sigwaiters;
static IQUEUE sigwaiters;
 
 
/*+ An array of queues of pending signals posted with sigqueue(). +*/
331,7 → 331,7
LEVEL l;
 
/* Reactivate the task... */
q_extract(p, &sigwaiters);
iq_extract(p, &sigwaiters);
 
l = proc_table[p].task_level;
level_table[l]->task_insert(l,p);
469,9 → 469,9
* in sigwait will have blocked the signals being waited for).
*/
 
for (task = sigwaiters;
for (task = iq_query_first(&sigwaiters);
task != NIL;
task = proc_table[task].next) {
task = iq_query_next(task, &sigwaiters)) {
if (sigismember(&proc_table[task].sigwaiting, signo)) {
LEVEL l;
 
479,7 → 479,7
sigaddset(&proc_table[task].sigpending, signo);
 
/* Reactivate the task... */
q_extract(task, &sigwaiters);
iq_extract(task, &sigwaiters);
l = proc_table[task].task_level;
level_table[l]->task_insert(l,task);
 
614,9 → 614,9
* the FIFO order, and how to prevent lost signals in the case that
* a thread calls sigwait before the woken thread runs and gets it.
*/
for (task = sigwaiters;
for (task = iq_query_first(&sigwaiters);
task != NIL;
task = proc_table[task].next) {
task = iq_query_next(task, &sigwaiters)) {
if (sigismember(&proc_table[task].sigwaiting, signo)) {
LEVEL l;
 
624,7 → 624,7
sigaddset(&proc_table[task].sigpending, signo);
 
/* Reactivate the task... */
q_extract(task, &sigwaiters);
iq_extract(task, &sigwaiters);
 
l = proc_table[task].task_level;
level_table[l]->task_insert(l,task);
697,7 → 697,7
proc_table[p].control |= SIGTIMEOUT_EXPIRED;
 
/* insert the task into the ready queue and extract it from the waiters */
q_extract(p, &sigwaiters);
iq_extract(p, &sigwaiters);
 
l = proc_table[p].task_level;
level_table[l]->task_insert(l,p);
754,7 → 754,7
* Grab the first queue entry.
*/
sos = sigqueued[thissig];
sigqueued[thissig] = sig_queue[sigqueued[thissig]].next;
sigqueued[thissig] = sig_queue[sos].next;
 
/*
* If that was the last one, reset the process procsigpending.
834,7 → 834,7
* find a thread in sigwait, but it will not be able to wake it up
* until the waitlock is released in the switch code.
*/
q_insertfirst(exec_shadow, &sigwaiters);
iq_insertfirst(exec_shadow, &sigwaiters);
proc_table[exec_shadow].status = WAIT_SIG;
 
if (timeout) {
890,7 → 890,8
/*
* Grab the first queue entry.
*/
sos = q_getfirst(&sigqueued[thissig]);
sos = sigqueued[thissig];
sigqueued[thissig] = sig_queue[sos].next;
 
/*
* If that was the last one, reset the process procsigpending.
1068,7 → 1069,7
l = proc_table[exec_shadow].task_level;
level_table[l]->task_extract(l,exec_shadow);
 
q_insertfirst(exec_shadow, &sigwaiters);
iq_insertfirst(exec_shadow, &sigwaiters);
proc_table[exec_shadow].status = WAIT_SIGSUSPEND;
 
/* and finally we reschedule */
1500,7 → 1501,7
proc_table[i].delay_timer = -1;
}
 
q_extract(i, &sigwaiters);
iq_extract(i, &sigwaiters);
 
l = proc_table[i].task_level;
level_table[l]->task_insert(l,i);
1544,7 → 1545,7
 
procsigpending = 0;
 
sigwaiters = NIL;
iq_init(&sigwaiters, &freedesc, 0);
alarm_timer = -1;
 
/* Interrupt handling init */