Skip to content

Commit 6cdfa92

Browse files
committed
WIP
1 parent 14a662b commit 6cdfa92

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

ext/io/event/worker_pool.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,15 @@ static VALUE worker_thread_func(void *_worker) {
180180

181181
while (true) {
182182
// Wait for work and execute it without holding GVL
183-
struct IO_Event_WorkerPool_Work *work = (struct IO_Event_WorkerPool_Work *)rb_thread_call_without_gvl(worker_wait_and_execute, worker, worker_unblock_func, worker);
183+
void *result = rb_thread_call_without_gvl(worker_wait_and_execute, worker, worker_unblock_func, worker);
184+
185+
// Check for error conditions from rb_thread_call_without_gvl
186+
if (result == (void*)-1) {
187+
// rb_thread_call_without_gvl returned an error, break out of loop
188+
break;
189+
}
190+
191+
struct IO_Event_WorkerPool_Work *work = (struct IO_Event_WorkerPool_Work *)result;
184192

185193
if (!work) {
186194
// Shutdown signal received

0 commit comments

Comments
 (0)