🌐 AI搜索 & 代理 主页
Skip to content

Commit 1866fa6

Browse files
committed
Break out of the loop on interrupt.
1 parent 5512447 commit 1866fa6

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

ext/-test-/scheduler/scheduler.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,12 @@ blocking_operation(void *argument)
4343

4444
write(blocking_state->notify_descriptor, "x", 1);
4545

46-
while (true) {
46+
while (!blocking_state->interrupted) {
4747
struct timeval tv = {1, 0}; // 1 second timeout.
4848
int result = select(0, NULL, NULL, NULL, &tv);
4949

5050
if (result == -1 && errno == EINTR) {
5151
blocking_state->interrupted = 1;
52-
return NULL;
5352
}
5453

5554
// Otherwise, timeout -> loop again.

0 commit comments

Comments
 (0)