20,11 → 20,11 |
|
/** |
------------ |
CVS : $Id: sem.c,v 1.4 2003-11-05 15:04:15 giacomo Exp $ |
CVS : $Id: sem.c,v 1.5 2003-11-06 09:42:23 giacomo Exp $ |
|
File: $File$ |
Revision: $Revision: 1.4 $ |
Last update: $Date: 2003-11-05 15:04:15 $ |
Revision: $Revision: 1.5 $ |
Last update: $Date: 2003-11-06 09:42:23 $ |
------------ |
|
This file contains the Hartik 3.3.1 Semaphore functions |
435,10 → 435,6 |
int sem_xwait(sem_t *s, int n, int wait) |
{ |
struct sem_des *s1; /* It speeds up access */ |
SYS_FLAGS f; |
|
f = kern_fsave(); |
kern_frestore(f); |
|
if (*s < 0 || *s >= SEM_NSEMS_MAX || !sem_table[*s].used) { |
errno = EINVAL; |
447,7 → 443,7 |
|
/* We do not need to save context if we are sure we shall not block! */ |
if (wait == NON_BLOCK) |
f = kern_fsave(); |
kern_cli(); |
else |
proc_table[exec_shadow].context = kern_context_save(); |
|
461,13 → 457,13 |
|
if (s1->blocked.first != NIL || s1->count < n) { |
errno = EAGAIN; |
kern_frestore(f); |
kern_sti(); |
return -1; |
} |
else |
s1->count -= n; |
|
kern_frestore(f); |
kern_sti(); |
return 0; |
} |
/* The blocking wait is more complex... */ |