mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-07 19:34:56 +00:00
lxip: poll_does_not_wait() for non-blocking API
This commit is contained in:
parent
8e6306e8e3
commit
1f29e1854a
@ -92,7 +92,6 @@ DUMMY_RET(0, nla_put)
|
||||
DUMMY_RET(1, ns_capable)
|
||||
DUMMY_RET(1, num_possible_cpus)
|
||||
DUMMY_RET(0, read_seqretry)
|
||||
DUMMY_RET(0, poll_does_not_wait)
|
||||
DUMMY_RET(0, secpath_exists)
|
||||
DUMMY_RET(0, security_inet_conn_request)
|
||||
DUMMY_RET(0, security_sk_alloc)
|
||||
|
@ -368,6 +368,11 @@ void poll_wait(struct file * filp, wait_queue_head_t * wait_address, poll_table
|
||||
_timeout->wait();
|
||||
}
|
||||
|
||||
bool poll_does_not_wait(const poll_table *p)
|
||||
{
|
||||
return p == nullptr;
|
||||
}
|
||||
|
||||
|
||||
/******************
|
||||
** linux/time.h **
|
||||
|
@ -56,6 +56,7 @@ class Nic_client
|
||||
*/
|
||||
void _packet_avail()
|
||||
{
|
||||
/* process a batch of only MAX_PACKETS in one run */
|
||||
enum { MAX_PACKETS = 20 };
|
||||
|
||||
int count = 0;
|
||||
@ -69,6 +70,7 @@ class Nic_client
|
||||
_nic.rx()->acknowledge_packet(p);
|
||||
}
|
||||
|
||||
/* schedule next batch if there are still packets available */
|
||||
if (_nic.rx()->packet_avail())
|
||||
Genode::Signal_transmitter(_sink_submit).submit();
|
||||
|
||||
|
@ -176,7 +176,7 @@ class Lx::Timer
|
||||
update_jiffies();
|
||||
|
||||
while (Lx::Timer::Context *ctx = _list.first()) {
|
||||
if (ctx->timeout > jiffies)
|
||||
if (ctx->timeout > jiffies)
|
||||
break;
|
||||
|
||||
ctx->function();
|
||||
|
Loading…
x
Reference in New Issue
Block a user