Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 219 → Rev 228

/shark/trunk/kernel/mutex.c
18,11 → 18,11
 
/**
------------
CVS : $Id: mutex.c,v 1.2 2003-01-07 17:07:49 pj Exp $
CVS : $Id: mutex.c,v 1.3 2003-09-12 10:10:41 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.2 $
Last update: $Date: 2003-01-07 17:07:49 $
Revision: $Revision: 1.3 $
Last update: $Date: 2003-09-12 10:10:41 $
------------
 
This file contains the mutex and condition variables handling functions.
101,8 → 101,10
mutex_resource_des *m = (mutex_resource_des *)resource_table[l];
 
/* can the mutex level manage the mutexattr_t ? */
if ((result = m->init(l, mutex, attr)) >=0)
if ((result = m->init(l, mutex, attr)) >=0) {
kern_sti();
return result;
}
}
}
kern_sti();
/shark/trunk/kernel/modules/pc.c
20,11 → 20,11
 
/**
------------
CVS : $Id: pc.c,v 1.2 2003-01-07 17:07:50 pj Exp $
CVS : $Id: pc.c,v 1.3 2003-09-12 10:10:41 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.2 $
Last update: $Date: 2003-01-07 17:07:50 $
Revision: $Revision: 1.3 $
Last update: $Date: 2003-09-12 10:10:41 $
------------
 
Priority Ceiling protocol. see pc.h for more details...
259,9 → 259,11
kern_cli();
 
p = (PC_mutex_t *)m->opt;
if (!p)
if (!p) {
/* if the mutex is not initialized, return an error! */
kern_sti();
return (EINVAL);
}
 
if (p->owner == exec_shadow) {
/* the task already owns the mutex */
269,9 → 271,11
return (EDEADLK);
}
 
if (p->ceiling > lev->priority[exec_shadow])
if (p->ceiling > lev->priority[exec_shadow]) {
/* see POSIX standard p. 258 */
kern_sti();
return (EINVAL);
}
 
while (!PC_accept(lev, lev->priority[exec_shadow])) {
/* the mutex is locked by someone,
315,9 → 319,11
kern_cli();
 
p = (PC_mutex_t *)m->opt;
if (!p)
if (!p) {
/* if the mutex is not initialized, return an error! */
kern_sti();
return (EINVAL);
}
 
if (p->owner == exec_shadow) {
/* the task already owns the mutex */
325,9 → 331,11
return (EDEADLK);
}
 
if (p->ceiling < lev->priority[exec_shadow])
if (p->ceiling < lev->priority[exec_shadow]) {
/* see POSIX standard p. 258 */
kern_sti();
return (EINVAL);
}
 
while (!PC_accept(lev, lev->priority[exec_shadow])) {
/* a task already owns the mutex */
/shark/trunk/kernel/signal.c
18,11 → 18,11
 
/**
------------
CVS : $Id: signal.c,v 1.3 2003-01-07 17:07:49 pj Exp $
CVS : $Id: signal.c,v 1.4 2003-09-12 10:10:41 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-09-12 10:10:41 $
------------
 
This file contains:
1279,8 → 1279,10
* Ignored?
*/
if (!(act.sa_flags & SA_SIGINFO) && (act.sa_handler == SIG_IGN ||
act.sa_handler == SIG_ERR) )
act.sa_handler == SIG_ERR) ) {
kern_frestore(f);
return;
}
 
if (!(act.sa_flags & SA_SIGINFO) && act.sa_handler == SIG_DFL) {
/* Default action for all signals is termination */
/shark/trunk/kernel/cancel.c
18,11 → 18,11
 
/**
------------
CVS : $Id: cancel.c,v 1.1.1.1 2002-03-29 14:12:51 pj Exp $
CVS : $Id: cancel.c,v 1.2 2003-09-12 10:10:40 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.1.1.1 $
Last update: $Date: 2002-03-29 14:12:51 $
Revision: $Revision: 1.2 $
Last update: $Date: 2003-09-12 10:10:40 $
------------
 
This file contains:
87,8 → 87,10
{
kern_cli();
if (state != TASK_CANCEL_ENABLE &&
state != TASK_CANCEL_DISABLE)
state != TASK_CANCEL_DISABLE) {
kern_sti();
return -1;
}
 
*oldstate = (proc_table[exec_shadow].control & KILL_ENABLED) != 0;
proc_table[exec_shadow].control &= ~KILL_ENABLED;
103,8 → 105,10
{
kern_cli();
if (type != TASK_CANCEL_DEFERRED &&
type != TASK_CANCEL_ASYNCHRONOUS)
type != TASK_CANCEL_ASYNCHRONOUS) {
kern_sti();
return -1;
}
 
*oldtype = (proc_table[exec_shadow].control & KILL_DEFERRED) != 0;
proc_table[exec_shadow].control &= ~KILL_DEFERRED;