From ff1d23eccba3ab37e77bf2d2222cad9d6f99a0ab Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Wed, 5 Nov 2025 12:27:26 -0800 Subject: Use a serial to keep track of Mutex-owning Fiber Previously this held a pointer to the Fiber itself, which requires marking it (which was only implemented recently, prior to that it was buggy). Using a monotonically increasing integer instead allows us to avoid having a free function and keeps everything simpler. My main motivations in making this change are that the root fiber lazily allocates self, which makes the writebarrier implementation challenging to do correctly, and wanting to avoid sending Mutexes to the remembered set when locked by a short-lived Fiber. --- internal/cont.h | 1 + 1 file changed, 1 insertion(+) (limited to 'internal') diff --git a/internal/cont.h b/internal/cont.h index 3c2528a02a..21a054f37c 100644 --- a/internal/cont.h +++ b/internal/cont.h @@ -31,5 +31,6 @@ VALUE rb_fiber_inherit_storage(struct rb_execution_context_struct *ec, struct rb VALUE rb_fiberptr_self(struct rb_fiber_struct *fiber); unsigned int rb_fiberptr_blocking(struct rb_fiber_struct *fiber); struct rb_execution_context_struct * rb_fiberptr_get_ec(struct rb_fiber_struct *fiber); +rb_serial_t rb_fiber_serial(const struct rb_fiber_struct *fiber); #endif /* INTERNAL_CONT_H */ -- cgit v1.2.3