diff options
author | Andreas Kling <kling@serenityos.org> | 2021-08-23 02:09:08 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-08-23 02:13:04 +0200 |
commit | 7006cb82bde1dbcd9465186fd31aa884e679f92c (patch) | |
tree | 9504d4c1ae3d4d936e6f5c68af0168c8164c347d /Kernel/Net | |
parent | 39474830a94fd812dca51ebe622751e364dc1044 (diff) | |
download | serenity-7006cb82bde1dbcd9465186fd31aa884e679f92c.zip |
Kernel: Rename Blocker::not_blocking(bool) to something more descriptive
Namely, will_unblock_immediately_without_blocking(Reason).
This virtual function is called on a blocker *before any block occurs*,
if it turns out that we don't need to block the thread after all.
This can happens for one of two reasons:
- UnblockImmediatelyReason::UnblockConditionAlreadyMet
We don't need to block the thread because the condition for
unblocking it is already met.
- UnblockImmediatelyReason::TimeoutInThePast
We don't need to block the thread because a timeout was specified
and that timeout is already in the past.
This patch does not introduce any behavior changes, it's only meant to
clarify this part of the blocking logic.
Diffstat (limited to 'Kernel/Net')
-rw-r--r-- | Kernel/Net/Routing.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Kernel/Net/Routing.cpp b/Kernel/Net/Routing.cpp index fbd752fc9a..e756237de7 100644 --- a/Kernel/Net/Routing.cpp +++ b/Kernel/Net/Routing.cpp @@ -26,7 +26,7 @@ public: virtual Type blocker_type() const override { return Type::Routing; } virtual bool should_block() override { return m_should_block; } - virtual void not_blocking(bool) override; + virtual void will_unblock_immediately_without_blocking(UnblockImmediatelyReason) override; bool unblock(bool from_add_blocker, const IPv4Address& ip_addr, const MACAddress& addr) { @@ -90,9 +90,9 @@ ARPTableBlocker::ARPTableBlocker(IPv4Address ip_addr, Optional<MACAddress>& addr m_should_block = false; } -void ARPTableBlocker::not_blocking(bool timeout_in_past) +void ARPTableBlocker::will_unblock_immediately_without_blocking(UnblockImmediatelyReason reason) { - VERIFY(timeout_in_past || !m_should_block); + VERIFY(reason == UnblockImmediatelyReason::TimeoutInThePast || !m_should_block); auto addr = arp_table().with_shared([&](const auto& table) -> auto { return table.get(ip_addr()); }); |