*
* \brief Semaphore based synchronization services.
*
- * \version $Id$
* \author Bernie Innocenti <bernie@codewiz.org>
*/
*/
void sem_release(struct Semaphore *s)
{
+ Process *proc = NULL;
+
proc_forbid();
sem_verify(s);
*/
if (--s->nest_count == 0)
{
- Process *proc;
-
/* Disown semaphore */
s->owner = NULL;
{
s->nest_count = 1;
s->owner = proc;
- ATOMIC(SCHED_ENQUEUE(proc));
}
}
-
proc_permit();
+
+ if (proc)
+ ATOMIC(proc_wakeup(proc));
}