summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2025-11-05 12:27:26 -0800
committerJohn Hawthorn <john@hawthorn.email>2025-11-20 14:06:33 -0800
commitff1d23eccba3ab37e77bf2d2222cad9d6f99a0ab (patch)
tree46ca6947b1297af3264c831353fdd7e5d98d86e1 /internal
parentd1b11592af75a5eee9199951a0c330eb8caa2825 (diff)
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.
Diffstat (limited to 'internal')
-rw-r--r--internal/cont.h1
1 files changed, 1 insertions, 0 deletions
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 */