Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Crystal::RWLock should be a struct #14345

Merged

Commits on Mar 5, 2024

  1. Fix: Crystal::RWLock should be a struct

    The Crystal::RWLock type is used to protect the GC against fiber context
    switches, to avoid the GC interrupting a thread while it is switching
    contexts, or starting a collection while a thread was preempted by the
    kernel while it was switching the fiber context.
    
    Problem is: Crystal::RWLock is a class, and thus depends on the GC to
    be allocated, and we end up in an infinite loop: GC depends on
    Crystal::RWLock that itself depends on GC, ...
    
    The weirdest part is that it's working, and I have no idea how.
    ysbaddaden committed Mar 5, 2024
    Configuration menu
    Copy the full SHA
    6cc7c8a View commit details
    Browse the repository at this point in the history