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

Immutable Event implementation #3198

Merged
merged 18 commits into from
Aug 16, 2024
Merged

Immutable Event implementation #3198

merged 18 commits into from
Aug 16, 2024

Commits on Aug 12, 2024

  1. use RwLock for interior mutability

    No deadlock reasoning:
    - RwLock can block when reader and writer threads are contesting access
    - When swap lock is acquired, we either have:
      - an exclusive write access from one of add, remove, or clear
      - a shared read access from call and one of add, remove, or clear
    - Otherwise,
      - when a change lock is acquired, we have a single read access from one of add, remove, or clear
      - when no lock is acquired, there is no access
    - Therefore delegates shouldn't deadlock
    lifers committed Aug 12, 2024
    Configuration menu
    Copy the full SHA
    2d7829a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    09a4de9 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0337f17 View commit details
    Browse the repository at this point in the history

Commits on Aug 13, 2024

  1. use cast to *mut Array<T>

    Assuming we have an exclusive access to the array
    lifers committed Aug 13, 2024
    Configuration menu
    Copy the full SHA
    33d8896 View commit details
    Browse the repository at this point in the history
  2. use cast to *mut Array<T>

    Assuming we have an exclusive access to the array
    lifers committed Aug 13, 2024
    Configuration menu
    Copy the full SHA
    db90add View commit details
    Browse the repository at this point in the history
  3. use cast to *mut Array<T>

    Assuming we have exclusive access to the array
    lifers committed Aug 13, 2024
    Configuration menu
    Copy the full SHA
    48024c2 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    49509e8 View commit details
    Browse the repository at this point in the history
  5. take &mut self to swap array

    use core::cell::UnsafeCell.
    lifers committed Aug 13, 2024
    Configuration menu
    Copy the full SHA
    253a005 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    b0df0b2 View commit details
    Browse the repository at this point in the history
  7. impl Send and Sync for Event

    lifers committed Aug 13, 2024
    Configuration menu
    Copy the full SHA
    fdaeb15 View commit details
    Browse the repository at this point in the history

Commits on Aug 15, 2024

  1. Replace Array<T> with Rust types

    The `Option` that wraps `Arc<[Delegate<T>]>` will let us assign `None` instead of creating `Arc::new([])` with no space penalty.
    lifers committed Aug 15, 2024
    Configuration menu
    Copy the full SHA
    9e4a471 View commit details
    Browse the repository at this point in the history

Commits on Aug 16, 2024

  1. construct Arc directly from iterator

    Now we only need to allocate once for Arc
    lifers committed Aug 16, 2024
    Configuration menu
    Copy the full SHA
    9449391 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d987a51 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    520b595 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    dff4499 View commit details
    Browse the repository at this point in the history
  5. Test for Send and Sync

    Should fail to compile if not
    lifers committed Aug 16, 2024
    Configuration menu
    Copy the full SHA
    208e52f View commit details
    Browse the repository at this point in the history
  6. formatting

    lifers committed Aug 16, 2024
    Configuration menu
    Copy the full SHA
    bf72954 View commit details
    Browse the repository at this point in the history
  7. Take the guard as late as possible

    Co-authored-by: Kenny Kerr <[email protected]>
    lifers and kennykerr authored Aug 16, 2024
    Configuration menu
    Copy the full SHA
    b0bc9b1 View commit details
    Browse the repository at this point in the history