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 the concurrency semantics for Gc<T>. #54

Merged
merged 3 commits into from
Apr 9, 2021

Commits on Apr 8, 2021

  1. Remove requirement that T: Sync

    This was included originally because of concerns about finalizing a
    non-Sync `T` value off-thread.
    
    If a value is `Sync`, it means that it is safe for two threads to access
    its data simultaneuosly: in other words, it has some synchronization
    guarantees. A common example is `RefCell`, which is safe to send between
    threads, but is marked `!Sync` because the dynamic borrow checking is
    not atomic. Finalizing `!Sync` values no longer problematic, because
    even though finalizers are run off-thread, they will run when the object
    is dead [1],  so there is no chance of a data race.
    
    [1]: softdevteam/alloy#30
    jacob-hughes committed Apr 8, 2021
    Configuration menu
    Copy the full SHA
    21ca9b8 View commit details
    Browse the repository at this point in the history
  2. Make Gc<T>: Send + Sync if T: Send + Sync

    This improves the ergonomics of `Gc<T>`, allowing nested `Gc` types
    without the need for introducing unsafe newtype workarounds [1].
    jacob-hughes committed Apr 8, 2021
    Configuration menu
    Copy the full SHA
    70ae093 View commit details
    Browse the repository at this point in the history

Commits on Apr 9, 2021

  1. Configuration menu
    Copy the full SHA
    17cf277 View commit details
    Browse the repository at this point in the history