Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 1502 → Rev 1503

//uspace/trunk/libc/include/futex.h
37,7 → 37,7
extern void futex_initialize(atomic_t *futex, int value);
extern int futex_down(atomic_t *futex);
extern int futex_trydown(atomic_t *futex);
extern int futex_down_timeout(atomic_t *futex, uint32_t usec, int trydown);
extern int futex_down_timeout(atomic_t *futex, uint32_t usec, int flags);
extern int futex_up(atomic_t *futex);
 
#endif
//uspace/trunk/libc/generic/ipc.c
360,7 → 360,7
ipc_callid_t callid;
 
do {
callid = ipc_wait_cycle(call, usec, SYNCH_BLOCKING);
callid = ipc_wait_cycle(call, usec, SYNCH_FLAGS_NONE);
} while (callid & IPC_CALLID_ANSWERED);
 
return callid;
377,7 → 377,7
ipc_callid_t callid;
 
do {
callid = ipc_wait_cycle(call, SYNCH_NO_TIMEOUT, SYNCH_NON_BLOCKING);
callid = ipc_wait_cycle(call, SYNCH_NO_TIMEOUT, SYNCH_FLAGS_NON_BLOCKING);
} while (callid & IPC_CALLID_ANSWERED);
 
return callid;
//uspace/trunk/libc/generic/async.c
507,7 → 507,7
timeout = SYNCH_NO_TIMEOUT;
futex_up(&async_futex);
 
callid = ipc_wait_cycle(&call, timeout, SYNCH_BLOCKING);
callid = ipc_wait_cycle(&call, timeout, SYNCH_FLAGS_NONE);
 
if (!callid) {
handle_expired_timeouts();
//uspace/trunk/libc/generic/futex.c
81,12 → 81,12
 
int futex_down(atomic_t *futex)
{
return futex_down_timeout(futex, SYNCH_NO_TIMEOUT, SYNCH_BLOCKING);
return futex_down_timeout(futex, SYNCH_NO_TIMEOUT, SYNCH_FLAGS_NONE);
}
 
int futex_trydown(atomic_t *futex)
{
return futex_down_timeout(futex, SYNCH_NO_TIMEOUT, SYNCH_NON_BLOCKING);
return futex_down_timeout(futex, SYNCH_NO_TIMEOUT, SYNCH_FLAGS_NON_BLOCKING);
}
 
/** Try to down the futex.
93,7 → 93,7
*
* @param futex Futex.
* @param usec Microseconds to wait. Zero value means sleep without timeout.
* @param trydown If usec is zero and trydown is non-zero, only conditional
* @param flags Select mode of operation. See comment for waitq_sleep_timeout().
*
* @return ENOENT if there is no such virtual address. One of ESYNCH_OK_ATOMIC
* and ESYNCH_OK_BLOCKED on success or ESYNCH_TIMEOUT if the lock was
100,12 → 100,12
* not acquired because of a timeout or ESYNCH_WOULD_BLOCK if the
* operation could not be carried out atomically (if requested so).
*/
int futex_down_timeout(atomic_t *futex, uint32_t usec, int trydown)
int futex_down_timeout(atomic_t *futex, uint32_t usec, int flags)
{
int rc;
while (atomic_predec(futex) < 0) {
rc = __SYSCALL3(SYS_FUTEX_SLEEP, (sysarg_t) &futex->count, (sysarg_t) usec, (sysarg_t) trydown);
rc = __SYSCALL3(SYS_FUTEX_SLEEP, (sysarg_t) &futex->count, (sysarg_t) usec, (sysarg_t) flags);
switch (rc) {
case ESYNCH_OK_ATOMIC: