Subversion Repositories shark

Compare Revisions

Regard whitespace Rev 38 → Rev 922

/shark/trunk/kernel/join.c
18,11 → 18,11
 
/**
------------
CVS : $Id: join.c,v 1.3 2003-01-07 17:07:49 pj Exp $
CVS : $Id: join.c,v 1.4 2003-11-05 15:05:11 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.3 $
Last update: $Date: 2003-01-07 17:07:49 $
Revision: $Revision: 1.4 $
Last update: $Date: 2003-11-05 15:05:11 $
------------
 
task join and related primitives
199,12 → 199,14
returns ESRCH if p is non correct +*/
int task_joinable(PID p)
{
SYS_FLAGS f;
 
if (p<0 || p>=MAX_PROC) return ESRCH;
if (proc_table[p].status == FREE) return ESRCH;
 
kern_cli();
f = kern_fsave();
proc_table[p].control |= TASK_JOINABLE;
kern_sti();
kern_frestore(f);
return 0;
}
 
215,19 → 217,21
ESRCH if p is not correct +*/
int task_unjoinable(PID p)
{
SYS_FLAGS f;
 
if (p<0 || p>=MAX_PROC) return ESRCH;
if (proc_table[p].status == FREE) return ESRCH;
 
kern_cli();
f = kern_fsave();
 
if (!(proc_table[p].control & TASK_JOINABLE) ||
proc_table[p].waiting_for_me != NIL) {
kern_sti();
kern_frestore(f);
return EINVAL;
}
 
proc_table[p].control |= TASK_JOINABLE;
 
kern_sti();
kern_frestore(f);
return 0;
}