Skip to content

Commit 1e60c13

Browse files
committed
Add documentation to blocked.
1 parent 1edf751 commit 1e60c13

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

ext/io/event/selector/epoll.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ struct IO_Event_Selector_EPoll
3838
{
3939
struct IO_Event_Selector backend;
4040
int descriptor;
41+
42+
// Flag indicating whether the selector is currently blocked in a system call.
43+
// Set to 1 when blocked in epoll_wait() without GVL, 0 otherwise.
44+
// Used by wakeup() to determine if an interrupt signal is needed.
4145
int blocked;
4246

4347
struct timespec idle_duration;

ext/io/event/selector/kqueue.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ struct IO_Event_Selector_KQueue
4747
{
4848
struct IO_Event_Selector backend;
4949
int descriptor;
50+
51+
// Flag indicating whether the selector is currently blocked in a system call.
52+
// Set to 1 when blocked in kevent() without GVL, 0 otherwise.
53+
// Used by wakeup() to determine if an interrupt signal is needed.
5054
int blocked;
5155

5256
struct timespec idle_duration;

ext/io/event/selector/uring.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ struct IO_Event_Selector_URing
3030
struct IO_Event_Selector backend;
3131
struct io_uring ring;
3232
size_t pending;
33+
34+
// Flag indicating whether the selector is currently blocked in a system call.
35+
// Set to 1 when blocked in io_uring_wait_cqe_timeout() without GVL, 0 otherwise.
36+
// Used by wakeup() to determine if an interrupt signal is needed.
3337
int blocked;
3438

3539
struct timespec idle_duration;

lib/io/event/selector/select.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ def initialize(loop)
1717

1818
@waiting = Hash.new.compare_by_identity
1919

20+
# Flag indicating whether the selector is currently blocked in a system call.
21+
# Set to true when blocked in ::IO.select, false otherwise.
22+
# Used by wakeup() to determine if an interrupt signal is needed.
2023
@blocked = false
2124

2225
@ready = Queue.new

0 commit comments

Comments
 (0)