Skip to content

Commit f18d8df

Browse files
Only do it after.
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent ea424f0 commit f18d8df

1 file changed

Lines changed: 1 addition & 18 deletions

File tree

scheduler.c

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,29 +1097,12 @@ VALUE rb_fiber_scheduler_blocking_operation_wait(VALUE scheduler, void* (*functi
10971097

10981098
// Create a new BlockingOperation with the blocking operation
10991099
VALUE blocking_operation = rb_fiber_scheduler_blocking_operation_new(function, data, unblock_function, data2, flags, state);
1100-
// Success, this works:
1101-
rb_fiber_scheduler_blocking_operation_t *operation = get_blocking_operation(blocking_operation);
11021100

1103-
size_t gc_count_before = rb_gc_count();
1104-
size_t minor_before = rb_gc_stat(ID2SYM(rb_intern("minor_gc_count")));
1105-
size_t major_before = rb_gc_stat(ID2SYM(rb_intern("major_gc_count")));
1106-
fprintf(stderr, "before rb_funcall: gc_count=%zu minor=%zu major=%zu operation=%p\n",
1107-
gc_count_before, minor_before, major_before, operation);
1101+
rb_fiber_scheduler_blocking_operation_t *operation = get_blocking_operation(blocking_operation);
11081102

11091103
VALUE result = rb_funcall(scheduler, id_blocking_operation_wait, 1, blocking_operation);
11101104

1111-
size_t gc_count_after = rb_gc_count();
1112-
size_t minor_after = rb_gc_stat(ID2SYM(rb_intern("minor_gc_count")));
1113-
size_t major_after = rb_gc_stat(ID2SYM(rb_intern("major_gc_count")));
1114-
fprintf(stderr, "after rb_funcall: gc_count=%zu minor=%zu major=%zu (delta: %zu minor, %zu major)\n",
1115-
gc_count_after, minor_after, major_after,
1116-
minor_after - minor_before, major_after - major_before);
1117-
1118-
fprintf(stderr, "blocking_operation_wait: operation=%p, operation->status=%d\n", operation, operation->status);
1119-
1120-
// Evidence suggests this fails:
11211105
operation = get_blocking_operation(blocking_operation);
1122-
fprintf(stderr, "get_blocking_operation: operation=%p, operation->status=%d\n", operation, operation->status);
11231106

11241107
// Get the operation data to check if it was executed
11251108
rb_atomic_t current_status = RUBY_ATOMIC_LOAD(operation->status);

0 commit comments

Comments
 (0)