From 046d6855f5e8a5039b319a47c3018a16d4c2f960 Mon Sep 17 00:00:00 2001 From: Tom Date: Sun, 29 Nov 2020 16:05:27 -0700 Subject: Kernel: Move block condition evaluation out of the Scheduler This makes the Scheduler a lot leaner by not having to evaluate block conditions every time it is invoked. Instead evaluate them as the states change, and unblock threads at that point. This also implements some more waitid/waitpid/wait features and behavior. For example, WUNTRACED and WNOWAIT are now supported. And wait will now not return EINTR when SIGCHLD is delivered at the same time. --- Kernel/Net/LocalSocket.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Kernel/Net/LocalSocket.h') diff --git a/Kernel/Net/LocalSocket.h b/Kernel/Net/LocalSocket.h index 30693283a3..3b9395d1a1 100644 --- a/Kernel/Net/LocalSocket.h +++ b/Kernel/Net/LocalSocket.h @@ -77,6 +77,14 @@ private: NonnullRefPtrVector& sendfd_queue_for(const FileDescription&); NonnullRefPtrVector& recvfd_queue_for(const FileDescription&); + void set_connect_side_role(Role connect_side_role, bool force_evaluate_block_conditions = false) + { + auto previous = m_connect_side_role; + m_connect_side_role = connect_side_role; + if (previous != m_connect_side_role || force_evaluate_block_conditions) + evaluate_block_conditions(); + } + // An open socket file on the filesystem. RefPtr m_file; -- cgit v1.2.3