mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-16 15:29:57 +00:00
parent
5fdacae88b
commit
60175631df
@ -19,8 +19,6 @@
|
||||
|
||||
namespace Lwip {
|
||||
void genode_init(Genode::Allocator &heap, ::Timer::Connection &timer);
|
||||
|
||||
Genode::Mutex &mutex();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -142,7 +142,6 @@ class Lwip::Nic_netif
|
||||
|
||||
void handle_rx_packets()
|
||||
{
|
||||
Genode::Mutex::Guard guard { Lwip::mutex() };
|
||||
auto &rx = *_nic.rx();
|
||||
|
||||
while (rx.packet_avail() && rx.ready_to_ack()) {
|
||||
|
@ -38,7 +38,6 @@ namespace Lwip {
|
||||
{
|
||||
void check_timeouts(Genode::Duration)
|
||||
{
|
||||
Genode::Mutex::Guard guard { Lwip::mutex() };
|
||||
sys_check_timeouts();
|
||||
}
|
||||
|
||||
@ -65,12 +64,6 @@ namespace Lwip {
|
||||
|
||||
lwip_init();
|
||||
}
|
||||
|
||||
Genode::Mutex &mutex()
|
||||
{
|
||||
static Genode::Mutex _lwip_mutex;
|
||||
return _lwip_mutex;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -906,7 +906,6 @@ class Lwip::Udp_socket_dir final :
|
||||
char *dst, file_size count,
|
||||
file_size &out_count) override
|
||||
{
|
||||
Genode::Mutex::Guard guard { Lwip::mutex() };
|
||||
Read_result result = Read_result::READ_ERR_INVALID;
|
||||
|
||||
switch(handle.kind) {
|
||||
@ -992,8 +991,6 @@ class Lwip::Udp_socket_dir final :
|
||||
char const *src, file_size count,
|
||||
file_size &out_count) override
|
||||
{
|
||||
Genode::Mutex::Guard guard { Lwip::mutex() };
|
||||
|
||||
switch (handle.kind) {
|
||||
|
||||
case Lwip_file_handle::DATA: {
|
||||
@ -1304,8 +1301,6 @@ class Lwip::Tcp_socket_dir final :
|
||||
char *dst, file_size count,
|
||||
file_size &out_count) override
|
||||
{
|
||||
Genode::Mutex::Guard g { Lwip::mutex() };
|
||||
|
||||
switch (handle.kind) {
|
||||
|
||||
case Lwip_file_handle::DATA:
|
||||
@ -1398,9 +1393,7 @@ class Lwip::Tcp_socket_dir final :
|
||||
|
||||
handle.kind = Lwip_file_handle::LOCATION;
|
||||
/* read the location of the new socket directory */
|
||||
Lwip::mutex().release();
|
||||
Read_result result = handle.read(dst, count, out_count);
|
||||
Lwip::mutex().acquire();
|
||||
|
||||
return result;
|
||||
}
|
||||
@ -1464,7 +1457,6 @@ class Lwip::Tcp_socket_dir final :
|
||||
char const *src, file_size count,
|
||||
file_size &out_count) override
|
||||
{
|
||||
Genode::Mutex::Guard guard { Lwip::mutex() };
|
||||
if (_pcb == NULL) {
|
||||
/* socket is closed */
|
||||
return Write_result::WRITE_ERR_IO;
|
||||
@ -1732,7 +1724,6 @@ class Lwip::File_system final : public Vfs::File_system, public Lwip::Directory
|
||||
typedef Genode::Fifo<Vfs_netif::Handle_element> Handle_queue;
|
||||
|
||||
Handle_queue blocked_handles { };
|
||||
Genode::Mutex blocked_handles_mutex { };
|
||||
|
||||
Vfs_netif(Vfs::Env &vfs_env,
|
||||
Genode::Xml_node config)
|
||||
@ -1751,8 +1742,6 @@ class Lwip::File_system final : public Vfs::File_system, public Lwip::Directory
|
||||
Handle_element *elem = new (handle.alloc())
|
||||
Handle_element(handle);
|
||||
|
||||
Genode::Mutex::Guard guard(blocked_handles_mutex);
|
||||
|
||||
blocked_handles.enqueue(*elem);
|
||||
}
|
||||
|
||||
@ -1767,8 +1756,6 @@ class Lwip::File_system final : public Vfs::File_system, public Lwip::Directory
|
||||
nameserver_handles.for_each([&] (Lwip_nameserver_handle &h) {
|
||||
h.io_progress_response(); });
|
||||
|
||||
Genode::Mutex::Guard guard(blocked_handles_mutex);
|
||||
|
||||
blocked_handles.dequeue_all([] (Handle_element &elem) {
|
||||
Vfs_handle &handle = elem.object();
|
||||
destroy(elem.object().alloc(), &elem);
|
||||
@ -1778,8 +1765,6 @@ class Lwip::File_system final : public Vfs::File_system, public Lwip::Directory
|
||||
|
||||
void drop(Vfs_handle &handle)
|
||||
{
|
||||
Genode::Mutex::Guard guard(blocked_handles_mutex);
|
||||
|
||||
blocked_handles.for_each([&] (Handle_element &elem) {
|
||||
if (&elem.object() == &handle) {
|
||||
blocked_handles.remove(elem);
|
||||
|
Loading…
x
Reference in New Issue
Block a user