mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-20 06:07:59 +00:00
parent
1776babbd1
commit
4949f3abba
@ -68,13 +68,13 @@ void wake_up_interruptible_sync_poll(wait_queue_head_t *wq, int)
|
||||
}
|
||||
|
||||
|
||||
void __wait_event(wait_queue_head_t wq)
|
||||
void ___wait_event(wait_queue_head_t *wq)
|
||||
{
|
||||
Wait_list *list = static_cast<Wait_list *>(wq.list);
|
||||
Wait_list *list = static_cast<Wait_list *>(wq->list);
|
||||
if (!list) {
|
||||
PWRN("__wait_event():dd empty list in wq: %p", &wq);
|
||||
init_waitqueue_head(&wq);
|
||||
list = static_cast<Wait_list *>(wq.list);
|
||||
PWRN("__wait_event(): empty list in wq: %p", wq);
|
||||
init_waitqueue_head(wq);
|
||||
list = static_cast<Wait_list *>(wq->list);
|
||||
}
|
||||
|
||||
Lx::Task *task = Lx::scheduler().current();
|
||||
|
@ -186,8 +186,9 @@ void add_wait_queue_exclusive(wait_queue_head_t *, wait_queue_t *);
|
||||
void remove_wait_queue(wait_queue_head_t *, wait_queue_t *);
|
||||
|
||||
/* our wait event implementation - it's okay as value */
|
||||
void __wait_event(wait_queue_head_t);
|
||||
void ___wait_event(wait_queue_head_t*);
|
||||
|
||||
#define __wait_event(wq) ___wait_event(&wq)
|
||||
#define _wait_event(wq, condition) while (!(condition)) { __wait_event(wq); }
|
||||
#define wait_event(wq, condition) ({ _wait_event(wq, condition); })
|
||||
#define wait_event_interruptible(wq, condition) ({ _wait_event(wq, condition); 0; })
|
||||
|
@ -287,7 +287,7 @@ struct Timeout : Genode::Signal_dispatcher<Timeout>
|
||||
};
|
||||
|
||||
|
||||
static void __wait_event(signed long timeout)
|
||||
static void wait_for_timeout(signed long timeout)
|
||||
{
|
||||
static Timer::Connection timer;
|
||||
Timeout to(timer, timeout);
|
||||
@ -307,7 +307,7 @@ long schedule_timeout_uninterruptible(signed long timeout)
|
||||
signed long schedule_timeout(signed long timeout)
|
||||
{
|
||||
long start = jiffies;
|
||||
__wait_event(timeout);
|
||||
wait_for_timeout(timeout);
|
||||
timeout -= jiffies - start;
|
||||
return timeout < 0 ? 0 : timeout;
|
||||
}
|
||||
@ -315,7 +315,7 @@ signed long schedule_timeout(signed long timeout)
|
||||
|
||||
void poll_wait(struct file * filp, wait_queue_head_t * wait_address, poll_table *p)
|
||||
{
|
||||
__wait_event(0);
|
||||
wait_for_timeout(0);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user