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 */ |