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

feature(neon): API for thread-local data #902

Merged
merged 33 commits into from
Jun 9, 2022
Merged

feature(neon): API for thread-local data #902

merged 33 commits into from
Jun 9, 2022

Commits on May 24, 2022

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

Commits on May 25, 2022

  1. Address review comments:

    - `GlobalTable::default()` to avoid boilerplate `new()` method
    - Rename `borrow()` and `borrow_mut()` to `get()` and `get_mut()`
    - Add `'static` bound to global contents
    - Use `cloned()` in test code
    dherman committed May 25, 2022
    Configuration menu
    Copy the full SHA
    f872b76 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6f12663 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    18e60f1 View commit details
    Browse the repository at this point in the history
  4. Immutable version of API:

    - `Global<T>::get()` returns an `Option<&T>`
    - `Global<T>::get_or_init()` returns an `&T`
    - Lifetime of returned reference is the inner `'cx` since the boxed reference is immutable
    dherman committed May 25, 2022
    Configuration menu
    Copy the full SHA
    b8b089b View commit details
    Browse the repository at this point in the history
  5. Explicitly name the types in the transmute

    Co-authored-by: K.J. Valencik <kjvalencik@gmail.com>
    dherman and kjvalencik committed May 25, 2022
    Configuration menu
    Copy the full SHA
    cf0d32a View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    f5cd0ba View commit details
    Browse the repository at this point in the history

Commits on May 27, 2022

  1. Add get_or_try_init and get_or_init_default

    - Also rename `get_or_init` to `get_or_init_with`
    - Also add `get_or_init` that takes an owned init value
    dherman committed May 27, 2022
    Configuration menu
    Copy the full SHA
    aee77f4 View commit details
    Browse the repository at this point in the history

Commits on Jun 1, 2022

  1. Protect re-entrant cases with "dirty" state checking

    - Uses an RAII pattern to ensure `get_or_try_init` always terminates cleanly
    - All initialization paths are checked for the dirty state to avoid re-entrancy
    - Also adds API docs and safety comments
    dherman committed Jun 1, 2022
    Configuration menu
    Copy the full SHA
    9075b76 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b28f439 View commit details
    Browse the repository at this point in the history
  3. Prettier fixups

    dherman committed Jun 1, 2022
    Configuration menu
    Copy the full SHA
    bbc4f22 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    ff75d2d View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    d9b8251 View commit details
    Browse the repository at this point in the history

Commits on Jun 2, 2022

  1. Global::new() can use the derived Default::default()

    Co-authored-by: K.J. Valencik <kjvalencik@gmail.com>
    dherman and kjvalencik committed Jun 2, 2022
    Configuration menu
    Copy the full SHA
    a66e511 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    507332d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0696901 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    574877b View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    b397e2d View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    bc7d09e View commit details
    Browse the repository at this point in the history

Commits on Jun 3, 2022

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

Commits on Jun 8, 2022

  1. Configuration menu
    Copy the full SHA
    3338877 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    42eec50 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    85d99f5 View commit details
    Browse the repository at this point in the history

Commits on Jun 9, 2022

  1. Addresses some of @kjvalencik's review suggestions:

    - Eliminate `get_or_init` and rename `get_or_init_with` to `get_or_init`
    - Add `# Panic` section to doc comment
    dherman committed Jun 9, 2022
    Configuration menu
    Copy the full SHA
    c906fbc View commit details
    Browse the repository at this point in the history
  2. Clarify doc text

    Co-authored-by: K.J. Valencik <kjvalencik@gmail.com>
    dherman and kjvalencik committed Jun 9, 2022
    Configuration menu
    Copy the full SHA
    0f57620 View commit details
    Browse the repository at this point in the history
  3. Idiomatic Rust variable name in doc example

    Co-authored-by: K.J. Valencik <kjvalencik@gmail.com>
    dherman and kjvalencik committed Jun 9, 2022
    Configuration menu
    Copy the full SHA
    14a2fe4 View commit details
    Browse the repository at this point in the history
  4. Link to neon::main docs in doc comment

    Co-authored-by: K.J. Valencik <kjvalencik@gmail.com>
    dherman and kjvalencik committed Jun 9, 2022
    Configuration menu
    Copy the full SHA
    019c2d3 View commit details
    Browse the repository at this point in the history
  5. Clarifying doc text about cross-thread sharing

    Co-authored-by: K.J. Valencik <kjvalencik@gmail.com>
    dherman and kjvalencik committed Jun 9, 2022
    Configuration menu
    Copy the full SHA
    58f80b3 View commit details
    Browse the repository at this point in the history
  6. s/fail/panic/ in doc text

    Co-authored-by: K.J. Valencik <kjvalencik@gmail.com>
    dherman and kjvalencik committed Jun 9, 2022
    Configuration menu
    Copy the full SHA
    f3cc0ab View commit details
    Browse the repository at this point in the history
  7. More docs improvements:

    - Add addon lifecycle diagram
    - Add panics notes to `Root::{into_inner, to_inner}`
    - Replace "immutable" with "thread-safe" in list of safe cases
    dherman committed Jun 9, 2022
    Configuration menu
    Copy the full SHA
    2005e61 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    d50ca63 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    ece0c02 View commit details
    Browse the repository at this point in the history
  10. A few last copy-editing nits

    dherman committed Jun 9, 2022
    Configuration menu
    Copy the full SHA
    310cb5b View commit details
    Browse the repository at this point in the history