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

Don't make `OsIpcSender` `Sync` #115

Merged
merged 3 commits into from Nov 8, 2016
Merged

Don't make `OsIpcSender` `Sync` #115

merged 3 commits into from Nov 8, 2016

Commits on Nov 3, 2016

  1. Don't make `OsIpcSender` `Sync`

    `mpsc::Sender` isn't `Sync` -- and the `ipc-channel` equivalent probably
    shouldn't be either. Sharing references to senders is usually not a good
    idea: they are rather meant to be cloned instead; and they implement
    internal sharing to make this efficient and robust -- sharing references
    to senders just adds an unnecessary extra layer of sharing on top.
    
    For the `inprocess` back-end, implementing `Sync` was necessitating
    use of an `Arc<Mutex<>>`, adding considerable overhead even when not
    used -- so this change is an optimisation. It effectively reverts most
    of the sender part of 30b2024 (the
    receiver part was already backed out in
    77469c2 ), except that it obviously
    doesn't re-introduce the bogus explicit `Sync` claim.
    
    For the `macos` and `unix` back-ends, the sender implementations were
    inherently `Sync`; so we explicitly mark them `!Sync` now, to get a
    consistent API.
    
    Also bumping the `ipc-channel` version here, as this is a breaking
    change.
    antrik committed Nov 3, 2016
  2. Tests: Add a test case to verify that `OsIpcSender` is `!Sync` now

    Unfortunately this requires an "unstable" feature to be enabled, because
    it relies on specialization... Can't think of any other way to handle
    this.
    antrik committed Nov 3, 2016
  3. CI: Build with `--features unstable`, to enable `!Sync` test

    antrik committed Nov 3, 2016
You can’t perform that action at this time.