Kernel: Protect network adapter list with spinlock instead of mutex

This commit is contained in:
Andreas Kling 2022-02-03 01:33:19 +01:00
parent 0899153170
commit 3becff9eae
Notes: sideshowbarker 2024-07-18 03:20:18 +09:00
2 changed files with 23 additions and 23 deletions

View file

@ -12,7 +12,7 @@
#include <AK/NonnullRefPtrVector.h>
#include <AK/Types.h>
#include <Kernel/Bus/PCI/Definitions.h>
#include <Kernel/Locking/Mutex.h>
#include <Kernel/Locking/SpinlockProtected.h>
#include <Kernel/Memory/Region.h>
namespace Kernel {
@ -40,9 +40,8 @@ public:
private:
RefPtr<NetworkAdapter> determine_network_device(PCI::DeviceIdentifier const&) const;
NonnullRefPtrVector<NetworkAdapter> m_adapters;
SpinlockProtected<NonnullRefPtrVector<NetworkAdapter>> m_adapters;
RefPtr<NetworkAdapter> m_loopback_adapter;
mutable Mutex m_lock { "Networking" };
};
}