GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — KQueue: exclude EVFILT_USER wakeup from IoHandler.run() return value · netty/netty@c744c62

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • transport-classes-kqueue/src/main/java/io/netty/channel/kqueue
    • KQueueIoHandler.java
  • transport-native-kqueue
    • pom.xml
    • src/test/java/io/netty/channel/kqueue
      • KQueueIoHandlerWakeupEventCountTest.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎transport-classes-kqueue/src/main/java/io/netty/channel/kqueue/KQueueIoHandler.java‎

Copy file name to clipboardExpand all lines: transport-classes-kqueue/src/main/java/io/netty/channel/kqueue/KQueueIoHandler.java
+6-5Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ private int kqueueWait(int timeoutSec, int timeoutNs) throws IOException {
189189
return numEvents;
190190
}
191191

192-
private void processReady(int ready) {
192+
private int processReady(int ready) {
193+
int ioCount = 0;
193194
for (int i = 0; i < ready; ++i) {
194195
final short filter = eventList.filter(i);
195196
final short flags = eventList.flags(i);
@@ -202,6 +203,7 @@ private void processReady(int ready) {
202203
continue;
203204
}
204205

206+
ioCount++;
205207
long id = eventList.udata(i);
206208
DefaultKqueueIoRegistration registration = registrations.get(id);
207209
if (registration == null) {
@@ -213,6 +215,7 @@ private void processReady(int ready) {
213215
}
214216
registration.handle(ident, filter, flags, eventList.fflags(i), eventList.data(i), id);
215217
}
218+
return ioCount;
216219
}
217220

218221
@Override
@@ -269,15 +272,13 @@ public int run(IoHandlerContext context) {
269272
}
270273

271274
if (strategy > 0) {
272-
handled = strategy;
273275
if (context.shouldReportActiveIoTime()) {
274-
// The Timer starts after the blocking kqueueWait() call returns with events.
275276
long activeIoStartTimeNanos = System.nanoTime();
276-
processReady(strategy);
277+
handled = processReady(strategy);
277278
long activeIoEndTimeNanos = System.nanoTime();
278279
context.reportActiveIoTime(activeIoEndTimeNanos - activeIoStartTimeNanos);
279280
} else {
280-
processReady(strategy);
281+
handled = processReady(strategy);
281282
}
282283
} else if (context.shouldReportActiveIoTime()) {
283284
context.reportActiveIoTime(0);
Collapse file

‎transport-native-kqueue/pom.xml‎

Copy file name to clipboardExpand all lines: transport-native-kqueue/pom.xml
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -726,6 +726,13 @@
726726
<artifactId>netty-transport</artifactId>
727727
<version>${project.version}</version>
728728
</dependency>
729+
<dependency>
730+
<groupId>io.netty</groupId>
731+
<artifactId>netty-transport</artifactId>
732+
<version>${project.version}</version>
733+
<type>test-jar</type>
734+
<scope>test</scope>
735+
</dependency>
729736
<dependency>
730737
<groupId>io.netty</groupId>
731738
<artifactId>netty-transport-native-unix-common</artifactId>
Collapse file

‎transport-native-kqueue/src/test/java/io/netty/channel/kqueue/KQueueIoHandlerWakeupEventCountTest.java‎

Copy file name to clipboard
+35Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright 2026 The Netty Project
3+
*
4+
* The Netty Project licenses this file to you under the Apache License,
5+
* version 2.0 (the "License"); you may not use this file except in compliance
6+
* with the License. You may obtain a copy of the License at:
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations
14+
* under the License.
15+
*/
16+
package io.netty.channel.kqueue;
17+
18+
import io.netty.channel.AbstractIoHandlerEventCountTest;
19+
import io.netty.channel.IoHandlerFactory;
20+
import org.junit.jupiter.api.BeforeAll;
21+
22+
import static org.junit.jupiter.api.Assumptions.assumeTrue;
23+
24+
public class KQueueIoHandlerWakeupEventCountTest extends AbstractIoHandlerEventCountTest {
25+
26+
@BeforeAll
27+
public static void loadJNI() {
28+
assumeTrue(KQueue.isAvailable());
29+
}
30+
31+
@Override
32+
protected IoHandlerFactory newIoHandlerFactory() {
33+
return KQueueIoHandler.newFactory();
34+
}
35+
}

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.