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

std: Rewrite Once with poisoning #32325

Merged
merged 1 commit into from
Mar 27, 2016
Merged

Commits on Mar 26, 2016

  1. std: Rewrite Once with poisoning

    This commit rewrites the `std::sync::Once` primitive with poisoning in mind in
    light of rust-lang#31688. Currently a panic in the initialization closure will cause
    future initialization closures to run, but the purpose of a Once is usually to
    initialize some global state so it's highly likely that the global state is
    corrupt if a panic happened. The same strategy of a mutex is taken where a panic
    is propagated by default.
    
    A new API, `call_once_force`, was added to subvert panics like is available on
    Mutex as well (for when panicking is handled internally).
    
    Adding this support was a significant enough change to the implementation that
    it was just completely rewritten from scratch, primarily to avoid using a
    `StaticMutex` which needs to have `destroy()` called on it at some point (a pain
    to do).
    
    Closes rust-lang#31688
    alexcrichton committed Mar 26, 2016
    Configuration menu
    Copy the full SHA
    c966c33 View commit details
    Browse the repository at this point in the history