mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-11 15:33:04 +00:00
parent
80d89c20fd
commit
31d7b3eb97
@ -1702,6 +1702,7 @@ class Lwip::File_system final : public Vfs::File_system, public Lwip::Directory
|
|||||||
typedef Genode::Fifo<Vfs_netif::Handle_element> Handle_queue;
|
typedef Genode::Fifo<Vfs_netif::Handle_element> Handle_queue;
|
||||||
|
|
||||||
Handle_queue blocked_handles { };
|
Handle_queue blocked_handles { };
|
||||||
|
Genode::Mutex blocked_handles_mutex { };
|
||||||
|
|
||||||
Vfs_netif(Vfs::Env &vfs_env,
|
Vfs_netif(Vfs::Env &vfs_env,
|
||||||
Genode::Xml_node config)
|
Genode::Xml_node config)
|
||||||
@ -1719,6 +1720,9 @@ class Lwip::File_system final : public Vfs::File_system, public Lwip::Directory
|
|||||||
{
|
{
|
||||||
Handle_element *elem = new (handle.alloc())
|
Handle_element *elem = new (handle.alloc())
|
||||||
Handle_element(handle);
|
Handle_element(handle);
|
||||||
|
|
||||||
|
Genode::Mutex::Guard guard(blocked_handles_mutex);
|
||||||
|
|
||||||
blocked_handles.enqueue(*elem);
|
blocked_handles.enqueue(*elem);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1733,6 +1737,8 @@ class Lwip::File_system final : public Vfs::File_system, public Lwip::Directory
|
|||||||
nameserver_handles.for_each([&] (Lwip_nameserver_handle &h) {
|
nameserver_handles.for_each([&] (Lwip_nameserver_handle &h) {
|
||||||
h.io_progress_response(); });
|
h.io_progress_response(); });
|
||||||
|
|
||||||
|
Genode::Mutex::Guard guard(blocked_handles_mutex);
|
||||||
|
|
||||||
blocked_handles.dequeue_all([] (Handle_element &elem) {
|
blocked_handles.dequeue_all([] (Handle_element &elem) {
|
||||||
Vfs_handle &handle = elem.object();
|
Vfs_handle &handle = elem.object();
|
||||||
destroy(elem.object().alloc(), &elem);
|
destroy(elem.object().alloc(), &elem);
|
||||||
@ -1742,6 +1748,8 @@ class Lwip::File_system final : public Vfs::File_system, public Lwip::Directory
|
|||||||
|
|
||||||
void drop(Vfs_handle &handle)
|
void drop(Vfs_handle &handle)
|
||||||
{
|
{
|
||||||
|
Genode::Mutex::Guard guard(blocked_handles_mutex);
|
||||||
|
|
||||||
blocked_handles.for_each([&] (Handle_element &elem) {
|
blocked_handles.for_each([&] (Handle_element &elem) {
|
||||||
if (&elem.object() == &handle) {
|
if (&elem.object() == &handle) {
|
||||||
blocked_handles.remove(elem);
|
blocked_handles.remove(elem);
|
||||||
|
Loading…
Reference in New Issue
Block a user