File tree Expand file tree Collapse file tree 4 files changed +15
-0
lines changed
Expand file tree Collapse file tree 4 files changed +15
-0
lines changed Original file line number Diff line number Diff 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 ;
Original file line number Diff line number Diff 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 ;
Original file line number Diff line number Diff 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 ;
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments