Full Code of crossbeam-rs/crossbeam for AI

master 03919fedb43c cached
176 files
1.5 MB
383.3k tokens
2166 symbols
1 requests
Download .txt
Showing preview only (1,552K chars total). Download the full file or copy to clipboard to get everything.
Repository: crossbeam-rs/crossbeam
Branch: master
Commit: 03919fedb43c
Files: 176
Total size: 1.5 MB

Directory structure:
gitextract_qjwqdnoi/

├── .clippy.toml
├── .editorconfig
├── .github/
│   ├── dependabot.yml
│   └── workflows/
│       ├── ci.yml
│       └── release.yml
├── .gitignore
├── .rustfmt.toml
├── .shellcheckrc
├── .taplo.toml
├── CHANGELOG.md
├── Cargo.toml
├── LICENSE-APACHE
├── LICENSE-MIT
├── README.md
├── build-common.rs
├── ci/
│   ├── careful.sh
│   ├── check-features.sh
│   ├── crossbeam-epoch-loom.sh
│   ├── dependencies.sh
│   ├── miri.sh
│   ├── no_atomic.sh
│   ├── san.sh
│   ├── test.sh
│   └── tsan
├── crossbeam-channel/
│   ├── CHANGELOG.md
│   ├── Cargo.toml
│   ├── LICENSE-APACHE
│   ├── LICENSE-MIT
│   ├── LICENSE-THIRD-PARTY
│   ├── README.md
│   ├── benches/
│   │   └── crossbeam.rs
│   ├── benchmarks/
│   │   ├── Cargo.toml
│   │   ├── README.md
│   │   ├── atomicring.rs
│   │   ├── atomicringqueue.rs
│   │   ├── bus.rs
│   │   ├── crossbeam-channel.rs
│   │   ├── crossbeam-deque.rs
│   │   ├── flume.rs
│   │   ├── futures-channel.rs
│   │   ├── go.go
│   │   ├── lockfree.rs
│   │   ├── message.rs
│   │   ├── mpmc.rs
│   │   ├── mpsc.rs
│   │   ├── plot.py
│   │   ├── run.sh
│   │   └── segqueue.rs
│   ├── examples/
│   │   ├── fibonacci.rs
│   │   ├── matching.rs
│   │   └── stopwatch.rs
│   ├── src/
│   │   ├── channel.rs
│   │   ├── context.rs
│   │   ├── counter.rs
│   │   ├── err.rs
│   │   ├── flavors/
│   │   │   ├── array.rs
│   │   │   ├── at.rs
│   │   │   ├── list.rs
│   │   │   ├── mod.rs
│   │   │   ├── never.rs
│   │   │   ├── tick.rs
│   │   │   └── zero.rs
│   │   ├── lib.rs
│   │   ├── select.rs
│   │   ├── select_macro.rs
│   │   ├── utils.rs
│   │   └── waker.rs
│   └── tests/
│       ├── after.rs
│       ├── array.rs
│       ├── golang.rs
│       ├── iter.rs
│       ├── list.rs
│       ├── mpsc.rs
│       ├── never.rs
│       ├── ready.rs
│       ├── same_channel.rs
│       ├── select.rs
│       ├── select_macro.rs
│       ├── thread_locals.rs
│       ├── tick.rs
│       └── zero.rs
├── crossbeam-deque/
│   ├── CHANGELOG.md
│   ├── Cargo.toml
│   ├── LICENSE-APACHE
│   ├── LICENSE-MIT
│   ├── README.md
│   ├── build.rs
│   ├── src/
│   │   ├── deque.rs
│   │   └── lib.rs
│   └── tests/
│       ├── fifo.rs
│       ├── injector.rs
│       ├── lifo.rs
│       └── steal.rs
├── crossbeam-epoch/
│   ├── CHANGELOG.md
│   ├── Cargo.toml
│   ├── LICENSE-APACHE
│   ├── LICENSE-MIT
│   ├── README.md
│   ├── benches/
│   │   ├── defer.rs
│   │   ├── flush.rs
│   │   └── pin.rs
│   ├── build.rs
│   ├── examples/
│   │   └── sanitize.rs
│   ├── src/
│   │   ├── atomic.rs
│   │   ├── collector.rs
│   │   ├── default.rs
│   │   ├── deferred.rs
│   │   ├── epoch.rs
│   │   ├── guard.rs
│   │   ├── internal.rs
│   │   ├── lib.rs
│   │   └── sync/
│   │       ├── list.rs
│   │       ├── mod.rs
│   │       └── queue.rs
│   └── tests/
│       └── loom.rs
├── crossbeam-queue/
│   ├── CHANGELOG.md
│   ├── Cargo.toml
│   ├── LICENSE-APACHE
│   ├── LICENSE-MIT
│   ├── README.md
│   ├── src/
│   │   ├── array_queue.rs
│   │   ├── lib.rs
│   │   └── seg_queue.rs
│   └── tests/
│       ├── array_queue.rs
│       └── seg_queue.rs
├── crossbeam-skiplist/
│   ├── CHANGELOG.md
│   ├── Cargo.toml
│   ├── LICENSE-APACHE
│   ├── LICENSE-MIT
│   ├── README.md
│   ├── benches/
│   │   ├── btree.rs
│   │   ├── hash.rs
│   │   ├── skiplist.rs
│   │   └── skipmap.rs
│   ├── examples/
│   │   └── simple.rs
│   ├── src/
│   │   ├── base.rs
│   │   ├── comparator.rs
│   │   ├── equivalent.rs
│   │   ├── lib.rs
│   │   ├── map.rs
│   │   └── set.rs
│   └── tests/
│       ├── base.rs
│       ├── map.rs
│       └── set.rs
├── crossbeam-utils/
│   ├── CHANGELOG.md
│   ├── Cargo.toml
│   ├── LICENSE-APACHE
│   ├── LICENSE-MIT
│   ├── README.md
│   ├── benches/
│   │   └── atomic_cell.rs
│   ├── build.rs
│   ├── src/
│   │   ├── alloc_helper.rs
│   │   ├── atomic/
│   │   │   ├── atomic_cell.rs
│   │   │   ├── consume.rs
│   │   │   ├── mod.rs
│   │   │   ├── seq_lock.rs
│   │   │   └── seq_lock_wide.rs
│   │   ├── backoff.rs
│   │   ├── cache_padded.rs
│   │   ├── lib.rs
│   │   ├── sync/
│   │   │   ├── mod.rs
│   │   │   ├── once_lock.rs
│   │   │   ├── parker.rs
│   │   │   ├── sharded_lock.rs
│   │   │   └── wait_group.rs
│   │   └── thread.rs
│   └── tests/
│       ├── atomic_cell.rs
│       ├── cache_padded.rs
│       ├── parker.rs
│       ├── sharded_lock.rs
│       ├── thread.rs
│       └── wait_group.rs
├── no_atomic.rs
├── src/
│   └── lib.rs
├── tests/
│   └── subcrates.rs
└── tools/
    └── publish.sh

================================================
FILE CONTENTS
================================================

================================================
FILE: .clippy.toml
================================================
# Clippy configuration
# https://doc.rust-lang.org/nightly/clippy/lint_configuration.html

allow-private-module-inception = true
avoid-breaking-exported-api = false
disallowed-names = []
disallowed-macros = [
    { path = "std::dbg", reason = "it is okay to use during development, but please do not include it in master branch" },
]
disallowed-methods = [
    # Use helper for safer allocation instead.
    { path = "alloc::alloc::alloc", replacement = "crate::alloc_helper::Global::allocate" },
    { path = "alloc::alloc::alloc_zeroed", replacement = "crate::alloc_helper::Global::allocate_zeroed" },
    { path = "alloc::alloc::dealloc", replacement = "crate::alloc_helper::Global::deallocate" },
]
disallowed-types = [
]


================================================
FILE: .editorconfig
================================================
# EditorConfig configuration
# https://editorconfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.{css,html,json,md,rb,sh,yml,yaml}]
indent_size = 2

[*.{js,yml,yaml}]
quote_type = single

[*.sh]
# https://google.github.io/styleguide/shellguide.html#s5.3-pipelines
binary_next_line = true
# https://google.github.io/styleguide/shellguide.html#s5.5-case-statement
switch_case_indent = true


================================================
FILE: .github/dependabot.yml
================================================
version: 2
updates:
  - package-ecosystem: cargo
    directory: /
    schedule:
      interval: weekly
    commit-message:
      prefix: ''
    labels: []
  - package-ecosystem: github-actions
    directory: /
    schedule:
      interval: weekly
    commit-message:
      prefix: ''
    labels: []


================================================
FILE: .github/workflows/ci.yml
================================================
name: CI

permissions:
  contents: read

on:
  pull_request:
  push:
    branches:
      - master
  schedule:
    - cron: '0 2 * * *'
  workflow_dispatch:

env:
  CARGO_INCREMENTAL: 0
  CARGO_NET_GIT_FETCH_WITH_CLI: true
  CARGO_NET_RETRY: 10
  CARGO_TERM_COLOR: always
  RUST_BACKTRACE: 1
  RUSTDOCFLAGS: -D warnings
  RUSTFLAGS: -D warnings
  RUSTUP_MAX_RETRIES: 10

defaults:
  run:
    shell: bash --noprofile --norc -CeEuxo pipefail {0}

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
  cancel-in-progress: true

jobs:
  check-external-types:
    uses: taiki-e/github-actions/.github/workflows/check-external-types.yml@main
  clippy:
    uses: taiki-e/github-actions/.github/workflows/clippy.yml@main
    with:
      fuzzy_provenance_casts: false # TODO
  docs:
    uses: taiki-e/github-actions/.github/workflows/docs.yml@main

  # Test crates on their minimum Rust versions and nightly Rust.
  test:
    env:
      RUST_VERSION: ${{ matrix.rust }}
      RUST_TARGET: ${{ matrix.target }}
    strategy:
      fail-fast: false
      matrix:
        include:
          - rust: '1.74'
            os: ubuntu-latest
          - rust: '1.74'
            os: ubuntu-24.04-arm
          - rust: '1.74'
            os: windows-latest
          - rust: stable
            os: ubuntu-latest
          - rust: stable
            os: ubuntu-24.04-arm
          - rust: stable
            os: windows-latest
          - rust: nightly
            os: ubuntu-latest
          - rust: nightly
            os: ubuntu-24.04-arm
          - rust: nightly
            os: macos-latest
          - rust: nightly
            os: windows-latest
          - rust: nightly
            os: ubuntu-latest
            target: i686-unknown-linux-gnu
          - rust: nightly
            os: ubuntu-24.04-arm
            target: armv7-unknown-linux-gnueabihf
          - rust: nightly
            os: ubuntu-latest
            target: powerpc64le-unknown-linux-gnu
          - rust: nightly
            os: ubuntu-latest
            target: s390x-unknown-linux-gnu
          # Test 32-bit target that does not have AtomicU64/AtomicI64.
          - rust: nightly
            os: ubuntu-latest
            target: armv5te-unknown-linux-gnueabi
          # Test target without stable inline asm support.
          - rust: stable
            os: ubuntu-latest
            target: sparc64-unknown-linux-gnu
    runs-on: ${{ matrix.os }}
    timeout-minutes: 60
    steps:
      - uses: taiki-e/checkout-action@v1
      - name: Install Rust
        uses: taiki-e/github-actions/install-rust@main
        with:
          toolchain: ${{ matrix.rust }}
      - uses: taiki-e/setup-cross-toolchain-action@v1
        with:
          target: ${{ matrix.target }}
        if: matrix.target != ''
      - run: |
          echo "RUSTFLAGS=${RUSTFLAGS} --cfg gha_macos_runner" >>"${GITHUB_ENV}"
          echo "RUSTDOCFLAGS=${RUSTDOCFLAGS} --cfg gha_macos_runner" >>"${GITHUB_ENV}"
        if: startsWith(matrix.os, 'macos')
      - name: Test
        run: ci/test.sh

  # Check all feature combinations works properly.
  features:
    env:
      RUST_VERSION: ${{ matrix.rust }}
    strategy:
      fail-fast: false
      matrix:
        rust:
          - msrv
          - nightly
    runs-on: ubuntu-latest
    timeout-minutes: 60
    steps:
      - uses: taiki-e/checkout-action@v1
      - name: Install Rust
        uses: taiki-e/github-actions/install-rust@main
        with:
          toolchain: ${{ matrix.rust }}
        if: matrix.rust != 'msrv'
      - name: Install cargo-hack
        uses: taiki-e/install-action@cargo-hack
      - name: Check features
        run: ci/check-features.sh

  # Check for duplicate dependencies.
  dependencies:
    runs-on: ubuntu-latest
    timeout-minutes: 60
    steps:
      - uses: taiki-e/checkout-action@v1
      - name: Install Rust
        uses: taiki-e/github-actions/install-rust@nightly
      - name: Install cargo-hack
        uses: taiki-e/install-action@cargo-hack
      - name: Install cargo-minimal-versions
        uses: taiki-e/install-action@cargo-minimal-versions
      - name: dependency tree check
        run: ci/dependencies.sh

  # When this job failed, run ci/no_atomic.sh and commit result changes.
  codegen:
    runs-on: ubuntu-latest
    permissions:
      contents: write
      pull-requests: write
    timeout-minutes: 60
    steps:
      - uses: taiki-e/checkout-action@v1
      - name: Install Rust
        uses: taiki-e/github-actions/install-rust@stable
      - run: ci/no_atomic.sh
      - run: git add -N . && git diff --exit-code
        if: github.repository_owner != 'crossbeam-rs' || github.event_name != 'schedule'
      - id: diff
        run: |
          git config user.name "Taiki Endo"
          git config user.email "te316e89@gmail.com"
          git add -N .
          if ! git diff --exit-code; then
              git add .
              git commit -m "Update no_atomic.rs"
              echo 'success=false' >>"${GITHUB_OUTPUT}"
          fi
        if: github.repository_owner == 'crossbeam-rs' && github.event_name == 'schedule'
      - uses: peter-evans/create-pull-request@v8
        with:
          title: Update no_atomic.rs
          body: |
            Auto-generated by [create-pull-request][1]
            [Please close and immediately reopen this pull request to run CI.][2]

            [1]: https://github.com/peter-evans/create-pull-request
            [2]: https://github.com/peter-evans/create-pull-request/blob/HEAD/docs/concepts-guidelines.md#workarounds-to-trigger-further-workflow-runs
          branch: update-no-atomic-rs
        if: github.repository_owner == 'crossbeam-rs' && github.event_name == 'schedule' && steps.diff.outputs.success == 'false'

  # Check formatting.
  fmt:
    runs-on: ubuntu-latest
    timeout-minutes: 60
    steps:
      - uses: taiki-e/checkout-action@v1
      - name: Install Rust
        uses: taiki-e/github-actions/install-rust@nightly
        with:
          component: rustfmt
      - name: Install shfmt
        uses: taiki-e/install-action@shfmt
      # `cargo fmt` cannot recognize files not included in the current workspace and modules
      # defined inside macros, so run rustfmt directly.
      # We need to use nightly rustfmt because we use the unstable formatting options of rustfmt.
      - run: rustfmt --check $(git ls-files '*.rs')
      - run: shfmt -d $(git ls-files '*.sh')
      - run: RUST_LOG=warn npx -y @taplo/cli fmt --check $(git ls-files '*.toml')

  # Run miri.
  miri:
    strategy:
      fail-fast: false
      matrix:
        group:
          - channel
          - others
        miriflags:
          - ''
          - '-Zmiri-tree-borrows'
    runs-on: ubuntu-latest
    timeout-minutes: 60
    steps:
      - uses: taiki-e/checkout-action@v1
      - name: Install Rust
        uses: taiki-e/github-actions/install-rust@nightly
        with:
          component: miri
      - name: miri
        run: ci/miri.sh ${{ matrix.group }}
        env:
          MIRIFLAGS: ${{ matrix.miriflags }}

  # Run cargo-careful.
  careful:
    runs-on: ubuntu-latest
    timeout-minutes: 60
    steps:
      - uses: taiki-e/checkout-action@v1
      - name: Install Rust
        uses: taiki-e/github-actions/install-rust@nightly
        with:
          component: rust-src
      - uses: taiki-e/install-action@cargo-careful
      - name: Run cargo-careful
        run: ci/careful.sh

  # Run sanitizers.
  san:
    runs-on: ubuntu-latest
    timeout-minutes: 60
    steps:
      - uses: taiki-e/checkout-action@v1
      - name: Install Rust
        uses: taiki-e/github-actions/install-rust@nightly
        with:
          component: rust-src
          target: x86_64-unknown-linux-gnuasan
      - name: Run sanitizers
        run: ci/san.sh

  # Run loom tests.
  loom:
    runs-on: ubuntu-latest
    timeout-minutes: 60
    steps:
      - uses: taiki-e/checkout-action@v1
      - name: Install Rust
        uses: taiki-e/github-actions/install-rust@stable
      - name: loom
        run: ci/crossbeam-epoch-loom.sh

  shellcheck:
    runs-on: ubuntu-latest
    timeout-minutes: 60
    steps:
      - uses: taiki-e/checkout-action@v1
      - name: Install shellcheck
        uses: taiki-e/install-action@shellcheck
      - run: shellcheck $(git ls-files '*.sh')


================================================
FILE: .github/workflows/release.yml
================================================
name: Release

permissions:
  contents: read

on:
  push:
    tags:
      - crossbeam-[0-9]+.*
      - crossbeam-[a-z]+-[0-9]+.*

defaults:
  run:
    shell: bash --noprofile --norc -CeEuxo pipefail {0}

jobs:
  create-release:
    if: github.repository_owner == 'crossbeam-rs'
    runs-on: ubuntu-latest
    timeout-minutes: 60
    permissions:
      contents: write # for taiki-e/create-gh-release-action
    steps:
      - uses: taiki-e/checkout-action@v1
      - uses: taiki-e/create-gh-release-action@v1
        with:
          prefix: crossbeam(-[a-z]+)?
          changelog: $prefix/CHANGELOG.md
          title: $prefix $version
          branch: master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        if: "!startsWith(github.ref_name, 'crossbeam-0')"
      # Since the crossbeam crate is located at the root, we need to handle it differently.
      # TODO: Consider moving crossbeam crate to a subdirectory.
      - uses: taiki-e/create-gh-release-action@v1
        with:
          prefix: crossbeam(-[a-z]+)?
          changelog: CHANGELOG.md
          title: crossbeam $version
          branch: master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        if: startsWith(github.ref_name, 'crossbeam-0')


================================================
FILE: .gitignore
================================================
/crossbeam-channel/benchmarks/*.txt
/crossbeam-channel/benchmarks/*.png
target/
Cargo.lock


================================================
FILE: .rustfmt.toml
================================================
# Rustfmt configuration
# https://github.com/rust-lang/rustfmt/blob/HEAD/Configurations.md

# Override the default formatting style.
# This is unstable (tracking issue: https://github.com/rust-lang/rustfmt/issues/4991).
imports_granularity = "Crate"
# This is unstable (tracking issue: https://github.com/rust-lang/rustfmt/issues/5083).
group_imports = "StdExternalCrate"

# Set the default settings again to always apply the proper formatting without
# being affected by the editor settings.
edition = "2021"
style_edition = "2024"
hard_tabs = false
newline_style = "Unix"
tab_spaces = 4


================================================
FILE: .shellcheckrc
================================================
# ShellCheck configuration
# https://github.com/koalaman/shellcheck/blob/HEAD/shellcheck.1.md#rc-files

# See also:
# https://github.com/koalaman/shellcheck/wiki/Optional
# https://google.github.io/styleguide/shellguide.html

# https://github.com/koalaman/shellcheck/wiki/Directive#external-sources
external-sources=true

# https://github.com/koalaman/shellcheck/wiki/SC2249
# enable=add-default-case

# https://github.com/koalaman/shellcheck/wiki/SC2244
enable=avoid-nullary-conditions

# https://github.com/koalaman/shellcheck/wiki/SC2312
# enable=check-extra-masked-returns

# https://github.com/koalaman/shellcheck/wiki/SC2310
# https://github.com/koalaman/shellcheck/wiki/SC2311
# enable=check-set-e-suppressed

# enable=check-unassigned-uppercase

# https://github.com/koalaman/shellcheck/wiki/SC2230
enable=deprecate-which

# https://github.com/koalaman/shellcheck/wiki/SC2248
enable=quote-safe-variables

# https://github.com/koalaman/shellcheck/wiki/SC2292
# https://google.github.io/styleguide/shellguide.html#s6.3-tests
enable=require-double-brackets

# https://github.com/koalaman/shellcheck/wiki/SC2250
# https://google.github.io/styleguide/shellguide.html#s5.6-variable-expansion
enable=require-variable-braces


================================================
FILE: .taplo.toml
================================================
# Taplo configuration
# https://taplo.tamasfe.dev/configuration/formatter-options.html

[formatting]
align_comments = false
allowed_blank_lines = 1
array_auto_collapse = false
array_auto_expand = false
indent_string = "    "


================================================
FILE: CHANGELOG.md
================================================
# Version 0.8.4

- Remove dependency on `cfg-if`. (#1072)

# Version 0.8.3

- Bump the minimum supported Rust version to 1.61. (#1037)

# Version 0.8.2

- Bump the minimum supported Rust version to 1.38. (#877)

# Version 0.8.1

- Support targets that do not have atomic CAS on stable Rust (#698)

# Version 0.8.0

- Bump the minimum supported Rust version to 1.36.
- Bump `crossbeam-channel` to `0.5`.
- Bump `crossbeam-deque` to `0.8`.
- Bump `crossbeam-epoch` to `0.9`.
- Bump `crossbeam-queue` to `0.3`.
- Bump `crossbeam-utils` to `0.8`.

# Version 0.7.3

- Fix breakage with nightly feature due to rust-lang/rust#65214.
- Bump `crossbeam-channel` to `0.4`.
- Bump `crossbeam-epoch` to `0.8`.
- Bump `crossbeam-queue` to `0.2`.
- Bump `crossbeam-utils` to `0.7`.

# Version 0.7.2

- Bump `crossbeam-channel` to `0.3.9`.
- Bump `crossbeam-epoch` to `0.7.2`.
- Bump `crossbeam-utils` to `0.6.6`.

# Version 0.7.1

- Bump `crossbeam-utils` to `0.6.5`.

# Version 0.7.0

- Remove `ArcCell`, `MsQueue`, and `TreiberStack`.
- Change the interface of `ShardedLock` to match `RwLock`.
- Add `SegQueue::len()`.
- Rename `SegQueue::try_pop()` to `SegQueue::pop()`.
- Change the return type of `SegQueue::pop()` to `Result`.
- Introduce `ArrayQueue`.
- Update dependencies.

# Version 0.6.0

- Update dependencies.

# Version 0.5.0

- Update `crossbeam-channel` to 0.3.
- Update `crossbeam-utils` to 0.6.
- Add `AtomicCell`, `SharedLock`, and `WaitGroup`.

# Version 0.4.1

- Fix a double-free bug in `MsQueue` and `SegQueue`.

# Version 0.4

- Switch to the new implementation of epoch-based reclamation in
  [`crossbeam-epoch`](https://github.com/crossbeam-rs/crossbeam-epoch), fixing numerous bugs in the
  old implementation.  Its API is changed in a backward-incompatible way.
- Switch to the new implementation of `CachePadded` and scoped thread in
  [`crossbeam-utils`](https://github.com/crossbeam-rs/crossbeam-utils).  The scoped thread API is
  changed in a backward-incompatible way.
- Switch to the new implementation of Chase-Lev deque in
  [`crossbeam-deque`](https://github.com/crossbeam-rs/crossbeam-deque).  Its API is changed in a
  backward-incompatible way.
- Export channel implemented in
  [`crossbeam-channel`](https://github.com/crossbeam-rs/crossbeam-channel).
- Remove `AtomicOption`.
- Implement `Default` and `From` traits.

# Version 0.3

- Introduced `ScopedThreadBuilder` with the ability to name threads and set stack size
- `Worker` methods in the Chase-Lev deque don't require mutable access anymore
- Fixed a bug when unblocking `pop()` in `MsQueue`
- Implemented `Drop` for `MsQueue`, `SegQueue`, and `TreiberStack`
- Implemented `Default` for `TreiberStack`
- Added `is_empty` to `SegQueue`
- Renamed `mem::epoch` to `epoch`
- Other bug fixes

# Version 0.2

- Changed existing non-blocking `pop` methods to `try_pop`
- Added blocking `pop` support to Michael-Scott queue
- Added Chase-Lev work-stealing deque

# Version 0.1

- Added [epoch-based memory management](http://aturon.github.io/blog/2015/08/27/epoch/)
- Added Michael-Scott queue
- Added Segmented array queue


================================================
FILE: Cargo.toml
================================================
[package]
name = "crossbeam"
# When publishing a new version:
# - Update CHANGELOG.md
# - Update README.md (when increasing major or minor version)
# - Run './tools/publish.sh crossbeam <version>'
version = "0.8.4"
edition = "2021"
# NB: Sync with msrv badge and "Compatibility" section in README.md
rust-version = "1.74"
license = "MIT OR Apache-2.0"
repository = "https://github.com/crossbeam-rs/crossbeam"
homepage = "https://github.com/crossbeam-rs/crossbeam"
description = "Tools for concurrent programming"
keywords = ["atomic", "garbage", "non-blocking", "lock-free", "rcu"]
categories = ["concurrency", "memory-management", "data-structures", "no-std"]
exclude = ["/.*", "/ci", "/tools"]

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[package.metadata.cargo_check_external_types]
# The following are external types that are allowed to be exposed in our public API.
allowed_external_types = [
    "crossbeam_channel",
    "crossbeam_channel::*",
    "crossbeam_deque",
    "crossbeam_epoch",
    "crossbeam_queue",
    "crossbeam_utils::*",
]

[features]
default = ["std"]

# Enable to use APIs that require `std`.
# This is enabled by default.
std = [
    "alloc",
    "crossbeam-channel/std",
    "crossbeam-deque/std",
    "crossbeam-epoch/std",
    "crossbeam-queue/std",
    "crossbeam-utils/std",
]

# Enable to use APIs that require `alloc`.
# This is enabled by default and also enabled if the `std` feature is enabled.
alloc = ["crossbeam-epoch/alloc", "crossbeam-queue/alloc"]

[dependencies]
crossbeam-channel = { version = "0.5.10", path = "crossbeam-channel", default-features = false, optional = true }
crossbeam-deque = { version = "0.8.4", path = "crossbeam-deque", default-features = false, optional = true }
crossbeam-epoch = { version = "0.9.17", path = "crossbeam-epoch", default-features = false, optional = true }
crossbeam-queue = { version = "0.3.10", path = "crossbeam-queue", default-features = false, optional = true }
crossbeam-utils = { version = "0.8.18", path = "crossbeam-utils", default-features = false, features = ["atomic"] }

[dev-dependencies]

[lints]
workspace = true

[workspace]
resolver = "2"
members = [
    ".",
    "crossbeam-channel",
    "crossbeam-channel/benchmarks",
    "crossbeam-deque",
    "crossbeam-epoch",
    "crossbeam-queue",
    "crossbeam-skiplist",
    "crossbeam-utils",
]

[workspace.lints.rust]
missing_debug_implementations = "warn"
rust_2018_idioms = "warn"
single_use_lifetimes = "warn"
unexpected_cfgs = { level = "warn", check-cfg = [
    'cfg(crossbeam_loom)',
    'cfg(crossbeam_sanitize)',
    'cfg(gha_macos_runner)',
] }
unreachable_pub = "warn"
# unsafe_op_in_unsafe_fn = "warn" # Set at crate-level instead since https://github.com/rust-lang/rust/pull/100081 is not available on MSRV
[workspace.lints.clippy]
# Suppress buggy or noisy clippy lints
bool_assert_comparison = { level = "allow", priority = 1 }
declare_interior_mutable_const = { level = "allow", priority = 1 } # https://github.com/rust-lang/rust-clippy/issues/7665
incompatible_msrv = { level = "allow", priority = 1 } # buggy: doesn't consider cfg, https://github.com/rust-lang/rust-clippy/issues/12280, https://github.com/rust-lang/rust-clippy/issues/12257#issuecomment-2093667187
lint_groups_priority = { level = "allow", priority = 1 } # https://github.com/rust-lang/rust-clippy/issues/12920
manual_map = { level = "allow", priority = 1 }
manual_range_contains = { level = "allow", priority = 1 } # https://github.com/rust-lang/rust-clippy/issues/6455#issuecomment-1225966395
type_complexity = { level = "allow", priority = 1 }


================================================
FILE: LICENSE-APACHE
================================================
                              Apache License
                        Version 2.0, January 2004
                     http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

   "License" shall mean the terms and conditions for use, reproduction,
   and distribution as defined by Sections 1 through 9 of this document.

   "Licensor" shall mean the copyright owner or entity authorized by
   the copyright owner that is granting the License.

   "Legal Entity" shall mean the union of the acting entity and all
   other entities that control, are controlled by, or are under common
   control with that entity. For the purposes of this definition,
   "control" means (i) the power, direct or indirect, to cause the
   direction or management of such entity, whether by contract or
   otherwise, or (ii) ownership of fifty percent (50%) or more of the
   outstanding shares, or (iii) beneficial ownership of such entity.

   "You" (or "Your") shall mean an individual or Legal Entity
   exercising permissions granted by this License.

   "Source" form shall mean the preferred form for making modifications,
   including but not limited to software source code, documentation
   source, and configuration files.

   "Object" form shall mean any form resulting from mechanical
   transformation or translation of a Source form, including but
   not limited to compiled object code, generated documentation,
   and conversions to other media types.

   "Work" shall mean the work of authorship, whether in Source or
   Object form, made available under the License, as indicated by a
   copyright notice that is included in or attached to the work
   (an example is provided in the Appendix below).

   "Derivative Works" shall mean any work, whether in Source or Object
   form, that is based on (or derived from) the Work and for which the
   editorial revisions, annotations, elaborations, or other modifications
   represent, as a whole, an original work of authorship. For the purposes
   of this License, Derivative Works shall not include works that remain
   separable from, or merely link (or bind by name) to the interfaces of,
   the Work and Derivative Works thereof.

   "Contribution" shall mean any work of authorship, including
   the original version of the Work and any modifications or additions
   to that Work or Derivative Works thereof, that is intentionally
   submitted to Licensor for inclusion in the Work by the copyright owner
   or by an individual or Legal Entity authorized to submit on behalf of
   the copyright owner. For the purposes of this definition, "submitted"
   means any form of electronic, verbal, or written communication sent
   to the Licensor or its representatives, including but not limited to
   communication on electronic mailing lists, source code control systems,
   and issue tracking systems that are managed by, or on behalf of, the
   Licensor for the purpose of discussing and improving the Work, but
   excluding communication that is conspicuously marked or otherwise
   designated in writing by the copyright owner as "Not a Contribution."

   "Contributor" shall mean Licensor and any individual or Legal Entity
   on behalf of whom a Contribution has been received by Licensor and
   subsequently incorporated within the Work.

2. Grant of Copyright License. Subject to the terms and conditions of
   this License, each Contributor hereby grants to You a perpetual,
   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
   copyright license to reproduce, prepare Derivative Works of,
   publicly display, publicly perform, sublicense, and distribute the
   Work and such Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of
   this License, each Contributor hereby grants to You a perpetual,
   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
   (except as stated in this section) patent license to make, have made,
   use, offer to sell, sell, import, and otherwise transfer the Work,
   where such license applies only to those patent claims licensable
   by such Contributor that are necessarily infringed by their
   Contribution(s) alone or by combination of their Contribution(s)
   with the Work to which such Contribution(s) was submitted. If You
   institute patent litigation against any entity (including a
   cross-claim or counterclaim in a lawsuit) alleging that the Work
   or a Contribution incorporated within the Work constitutes direct
   or contributory patent infringement, then any patent licenses
   granted to You under this License for that Work shall terminate
   as of the date such litigation is filed.

4. Redistribution. You may reproduce and distribute copies of the
   Work or Derivative Works thereof in any medium, with or without
   modifications, and in Source or Object form, provided that You
   meet the following conditions:

   (a) You must give any other recipients of the Work or
       Derivative Works a copy of this License; and

   (b) You must cause any modified files to carry prominent notices
       stating that You changed the files; and

   (c) You must retain, in the Source form of any Derivative Works
       that You distribute, all copyright, patent, trademark, and
       attribution notices from the Source form of the Work,
       excluding those notices that do not pertain to any part of
       the Derivative Works; and

   (d) If the Work includes a "NOTICE" text file as part of its
       distribution, then any Derivative Works that You distribute must
       include a readable copy of the attribution notices contained
       within such NOTICE file, excluding those notices that do not
       pertain to any part of the Derivative Works, in at least one
       of the following places: within a NOTICE text file distributed
       as part of the Derivative Works; within the Source form or
       documentation, if provided along with the Derivative Works; or,
       within a display generated by the Derivative Works, if and
       wherever such third-party notices normally appear. The contents
       of the NOTICE file are for informational purposes only and
       do not modify the License. You may add Your own attribution
       notices within Derivative Works that You distribute, alongside
       or as an addendum to the NOTICE text from the Work, provided
       that such additional attribution notices cannot be construed
       as modifying the License.

   You may add Your own copyright statement to Your modifications and
   may provide additional or different license terms and conditions
   for use, reproduction, or distribution of Your modifications, or
   for any such Derivative Works as a whole, provided Your use,
   reproduction, and distribution of the Work otherwise complies with
   the conditions stated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise,
   any Contribution intentionally submitted for inclusion in the Work
   by You to the Licensor shall be under the terms and conditions of
   this License, without any additional terms or conditions.
   Notwithstanding the above, nothing herein shall supersede or modify
   the terms of any separate license agreement you may have executed
   with Licensor regarding such Contributions.

6. Trademarks. This License does not grant permission to use the trade
   names, trademarks, service marks, or product names of the Licensor,
   except as required for reasonable and customary use in describing the
   origin of the Work and reproducing the content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or
   agreed to in writing, Licensor provides the Work (and each
   Contributor provides its Contributions) on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
   implied, including, without limitation, any warranties or conditions
   of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
   PARTICULAR PURPOSE. You are solely responsible for determining the
   appropriateness of using or redistributing the Work and assume any
   risks associated with Your exercise of permissions under this License.

8. Limitation of Liability. In no event and under no legal theory,
   whether in tort (including negligence), contract, or otherwise,
   unless required by applicable law (such as deliberate and grossly
   negligent acts) or agreed to in writing, shall any Contributor be
   liable to You for damages, including any direct, indirect, special,
   incidental, or consequential damages of any character arising as a
   result of this License or out of the use or inability to use the
   Work (including but not limited to damages for loss of goodwill,
   work stoppage, computer failure or malfunction, or any and all
   other commercial damages or losses), even if such Contributor
   has been advised of the possibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing
   the Work or Derivative Works thereof, You may choose to offer,
   and charge a fee for, acceptance of support, warranty, indemnity,
   or other liability obligations and/or rights consistent with this
   License. However, in accepting such obligations, You may act only
   on Your own behalf and on Your sole responsibility, not on behalf
   of any other Contributor, and only if You agree to indemnify,
   defend, and hold each Contributor harmless for any liability
   incurred by, or claims asserted against, such Contributor by reason
   of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

   To apply the Apache License to your work, attach the following
   boilerplate notice, with the fields enclosed by brackets "[]"
   replaced with your own identifying information. (Don't include
   the brackets!)  The text should be enclosed in the appropriate
   comment syntax for the file format. We also recommend that a
   file or class name and description of purpose be included on the
   same "printed page" as the copyright notice for easier
   identification within third-party archives.

Copyright 2019 The Crossbeam Project Developers

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

	http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


================================================
FILE: LICENSE-MIT
================================================
The MIT License (MIT)

Copyright (c) 2019 The Crossbeam Project Developers

Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the
Software without restriction, including without
limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software
is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice
shall be included in all copies or substantial portions
of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.


================================================
FILE: README.md
================================================
# Crossbeam

[![Build Status](https://github.com/crossbeam-rs/crossbeam/workflows/CI/badge.svg)](
https://github.com/crossbeam-rs/crossbeam/actions)
[![License](https://img.shields.io/badge/license-MIT_OR_Apache--2.0-blue.svg)](
https://github.com/crossbeam-rs/crossbeam#license)
[![Cargo](https://img.shields.io/crates/v/crossbeam.svg)](
https://crates.io/crates/crossbeam)
[![Documentation](https://docs.rs/crossbeam/badge.svg)](
https://docs.rs/crossbeam)
[![Rust 1.74+](https://img.shields.io/badge/rust-1.74+-lightgray.svg)](
https://www.rust-lang.org)
[![chat](https://img.shields.io/discord/569610676205781012.svg?logo=discord)](https://discord.com/invite/JXYwgWZ)

This crate provides a set of tools for concurrent programming:

#### Atomics

* [`AtomicCell`], a thread-safe mutable memory location.<sup>(no_std)</sup>
* [`AtomicConsume`], for reading from primitive atomic types with "consume" ordering.<sup>(no_std)</sup>

#### Data structures

* [`deque`], work-stealing deques for building task schedulers.
* [`ArrayQueue`], a bounded MPMC queue that allocates a fixed-capacity buffer on construction.<sup>(alloc)</sup>
* [`SegQueue`], an unbounded MPMC queue that allocates small buffers, segments, on demand.<sup>(alloc)</sup>

#### Memory management

* [`epoch`], an epoch-based garbage collector.<sup>(alloc)</sup>

#### Thread synchronization

* [`channel`], multi-producer multi-consumer channels for message passing.
* [`Parker`], a thread parking primitive.
* [`ShardedLock`], a sharded reader-writer lock with fast concurrent reads.
* [`WaitGroup`], for synchronizing the beginning or end of some computation.

#### Utilities

* [`Backoff`], for exponential backoff in spin loops.<sup>(no_std)</sup>
* [`CachePadded`], for padding and aligning a value to the length of a cache line.<sup>(no_std)</sup>
* [`scope`], for spawning threads that borrow local variables from the stack.

*Features marked with <sup>(no_std)</sup> can be used in `no_std` environments.*<br/>
*Features marked with <sup>(alloc)</sup> can be used in `no_std` environments, but only if `alloc`
feature is enabled.*

[`AtomicCell`]: https://docs.rs/crossbeam/latest/crossbeam/atomic/struct.AtomicCell.html
[`AtomicConsume`]: https://docs.rs/crossbeam/latest/crossbeam/atomic/trait.AtomicConsume.html
[`deque`]: https://docs.rs/crossbeam/latest/crossbeam/deque/index.html
[`ArrayQueue`]: https://docs.rs/crossbeam/latest/crossbeam/queue/struct.ArrayQueue.html
[`SegQueue`]: https://docs.rs/crossbeam/latest/crossbeam/queue/struct.SegQueue.html
[`channel`]: https://docs.rs/crossbeam/latest/crossbeam/channel/index.html
[`Parker`]: https://docs.rs/crossbeam/latest/crossbeam/sync/struct.Parker.html
[`ShardedLock`]: https://docs.rs/crossbeam/latest/crossbeam/sync/struct.ShardedLock.html
[`WaitGroup`]: https://docs.rs/crossbeam/latest/crossbeam/sync/struct.WaitGroup.html
[`epoch`]: https://docs.rs/crossbeam/latest/crossbeam/epoch/index.html
[`Backoff`]: https://docs.rs/crossbeam/latest/crossbeam/utils/struct.Backoff.html
[`CachePadded`]: https://docs.rs/crossbeam/latest/crossbeam/utils/struct.CachePadded.html
[`scope`]: https://docs.rs/crossbeam/latest/crossbeam/fn.scope.html

## Crates

The main `crossbeam` crate just [re-exports](src/lib.rs) tools from
smaller subcrates:

* [`crossbeam-channel`](crossbeam-channel)
  provides multi-producer multi-consumer channels for message passing.
* [`crossbeam-deque`](crossbeam-deque)
  provides work-stealing deques, which are primarily intended for building task schedulers.
* [`crossbeam-epoch`](crossbeam-epoch)
  provides epoch-based garbage collection for building concurrent data structures.
* [`crossbeam-queue`](crossbeam-queue)
  provides concurrent queues that can be shared among threads.
* [`crossbeam-utils`](crossbeam-utils)
  provides atomics, synchronization primitives, scoped threads, and other utilities.

There is one more experimental subcrate that is not yet included in `crossbeam`:

* [`crossbeam-skiplist`](crossbeam-skiplist)
  provides concurrent maps and sets based on lock-free skip lists.

## Usage

Add this to your `Cargo.toml`:

```toml
[dependencies]
crossbeam = "0.8"
```

## Compatibility

Crossbeam supports stable Rust releases going back at least six months,
and every time the minimum supported Rust version is increased, a new minor
version is released. Currently, the minimum supported Rust version is 1.74.

## Contributing

Crossbeam welcomes contribution from everyone in the form of suggestions, bug reports,
pull requests, and feedback. 💛

If you need ideas for contribution, there are several ways to get started:

* Found a bug or have a feature request?
  [Submit an issue](https://github.com/crossbeam-rs/crossbeam/issues/new)!
* Issues and PRs labeled with
  [feedback wanted](https://github.com/crossbeam-rs/crossbeam/issues?utf8=%E2%9C%93&q=is%3Aopen+sort%3Aupdated-desc+label%3A%22feedback+wanted%22+)
  need feedback from users and contributors.
* Issues labeled with
  [good first issue](https://github.com/crossbeam-rs/crossbeam/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22good+first+issue%22)
  are relatively easy starter issues.

#### RFCs

We also have the [RFCs](https://github.com/crossbeam-rs/rfcs) repository for more
high-level discussion, which is the place where we brainstorm ideas and propose
substantial changes to Crossbeam.

You are welcome to participate in any open
[issues](https://github.com/crossbeam-rs/rfcs/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)
or
[pull requests](https://github.com/crossbeam-rs/rfcs/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc).

#### Learning resources

If you'd like to learn more about concurrency and non-blocking data structures, there's a
list of learning resources in our [wiki](https://github.com/crossbeam-rs/rfcs/wiki),
which includes relevant blog posts, papers, videos, and other similar projects.

Another good place to visit is [merged RFCs](https://github.com/crossbeam-rs/rfcs/tree/master/text).
They contain elaborate descriptions and rationale for features we've introduced to
Crossbeam, but keep in mind that some of the written information is now out of date.

#### Conduct

The Crossbeam project adheres to the
[Rust Code of Conduct](https://www.rust-lang.org/policies/code-of-conduct).
This describes the minimum behavior expected from all contributors.

## License

Licensed under either of

 * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
 * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)

at your option.

Some Crossbeam subcrates have additional licensing notices.
Take a look at other readme files in this repository for more information.

#### Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
dual licensed as above, without any additional terms or conditions.


================================================
FILE: build-common.rs
================================================
// The target triplets have the form of 'arch-vendor-system'.
//
// When building for Linux (e.g. the 'system' part is
// 'linux-something'), replace the vendor with 'unknown'
// so that mapping to rust standard targets happens correctly.
fn convert_custom_linux_target(target: String) -> String {
    let mut parts: Vec<&str> = target.split('-').collect();
    let system = parts.get(2);
    if system == Some(&"linux") {
        parts[1] = "unknown";
    };
    parts.join("-")
}


================================================
FILE: ci/careful.sh
================================================
#!/bin/bash
set -euxo pipefail
IFS=$'\n\t'
cd "$(dirname "$0")"/..

export RUSTFLAGS="${RUSTFLAGS:-} -Z randomize-layout"

cargo careful test --all --all-features --exclude benchmarks -- --test-threads=1


================================================
FILE: ci/check-features.sh
================================================
#!/bin/bash
set -euxo pipefail
IFS=$'\n\t'
cd "$(dirname "$0")"/..

# * `--feature-powerset` - run for the feature powerset which includes --no-default-features and default features of package
# * `--no-dev-deps` - build without dev-dependencies to avoid https://github.com/rust-lang/cargo/issues/4866
# * `--exclude benchmarks` - benchmarks doesn't published.
if [[ "${RUST_VERSION}" == "msrv" ]]; then
  cargo hack build --all --feature-powerset --no-dev-deps --exclude crossbeam-utils --exclude benchmarks --rust-version
  # atomic feature requires Rust 1.74.
  cargo hack build -p crossbeam-utils --feature-powerset --no-dev-deps --rust-version --exclude-features atomic
  cargo +1.74 hack build -p crossbeam-utils --feature-powerset --no-dev-deps
else
  cargo hack build --all --feature-powerset --no-dev-deps --exclude benchmarks
fi

if [[ "${RUST_VERSION}" == "nightly"* ]]; then
  # Build for no_std environment.
  # thumbv7m-none-eabi supports atomic CAS.
  # thumbv6m-none-eabi supports atomic, but not atomic CAS.
  # riscv32i-unknown-none-elf does not support atomic at all.
  rustup target add thumbv7m-none-eabi
  rustup target add thumbv6m-none-eabi
  rustup target add riscv32i-unknown-none-elf
  cargo hack build --all --feature-powerset --no-dev-deps --exclude benchmarks --target thumbv7m-none-eabi --skip std,default
  cargo hack build --all --feature-powerset --no-dev-deps --exclude benchmarks --target thumbv6m-none-eabi --skip std,default
  cargo hack build --all --feature-powerset --no-dev-deps --exclude benchmarks --target riscv32i-unknown-none-elf --skip std,default
fi


================================================
FILE: ci/crossbeam-epoch-loom.sh
================================================
#!/bin/bash
set -euxo pipefail
IFS=$'\n\t'
cd "$(dirname "$0")"/../crossbeam-epoch

export RUSTFLAGS="${RUSTFLAGS:-} --cfg crossbeam_loom --cfg crossbeam_sanitize"

# With MAX_PREEMPTIONS=2 the loom tests (currently) take around 11m.
# If we were to run with =3, they would take several times that,
# which is probably too costly for CI.
env LOOM_MAX_PREEMPTIONS=2 cargo test --test loom --release --features loom -- --nocapture


================================================
FILE: ci/dependencies.sh
================================================
#!/bin/bash
set -euxo pipefail
IFS=$'\n\t'
cd "$(dirname "$0")"/..

cargo tree
cargo tree --duplicate

# Check minimal versions.
cargo minimal-versions build --workspace --all-features --exclude benchmarks


================================================
FILE: ci/miri.sh
================================================
#!/bin/bash
set -euxo pipefail
IFS=$'\n\t'
cd "$(dirname "$0")"/..

group=$1

# We need 'ts' for the per-line timing
sudo apt-get -y install moreutils
echo

export RUSTFLAGS="${RUSTFLAGS:-} -Z randomize-layout"
export RUSTDOCFLAGS="${RUSTDOCFLAGS:-} -Z randomize-layout"
export MIRIFLAGS="${MIRIFLAGS:-} -Zmiri-strict-provenance -Zmiri-symbolic-alignment-check -Zmiri-disable-isolation"

case "${group}" in
  channel)
    MIRI_LEAK_CHECK='1' \
      cargo miri test --all-features \
      -p crossbeam-channel 2>&1 | ts -i '%.s  '
    # -Zmiri-ignore-leaks is needed because we use detached threads in tests in tests/golang.rs: https://github.com/rust-lang/miri/issues/1371
    MIRIFLAGS="${MIRIFLAGS} -Zmiri-ignore-leaks" \
      cargo miri test --all-features \
      -p crossbeam-channel --test golang 2>&1 | ts -i '%.s  '
    ;;
  others)
    cargo miri test --all-features \
      -p crossbeam-queue \
      -p crossbeam-epoch \
      -p crossbeam-utils \
      -p crossbeam-skiplist \
      -p crossbeam 2>&1 | ts -i '%.s  '
    # -Zmiri-preemption-rate=0 is needed because this code technically has UB and Miri catches that.
    MIRI_FALLIBLE_WEAK_CAS='1' \
      MIRIFLAGS="${MIRIFLAGS} -Zmiri-preemption-rate=0" \
      cargo miri test --all-features \
      -p crossbeam-deque 2>&1 | ts -i '%.s  '
    # -Zmiri-compare-exchange-weak-failure-rate=0.0 is needed because some sequential tests (e.g.,
    # doctest of Injector::steal) incorrectly assume that sequential weak CAS will never fail.
    # -Zmiri-preemption-rate=0 is needed because this code technically has UB and Miri catches that.
    MIRIFLAGS="${MIRIFLAGS} -Zmiri-compare-exchange-weak-failure-rate=0.0 -Zmiri-preemption-rate=0" \
      cargo miri test --all-features \
      -p crossbeam-deque --test injector 2>&1 | ts -i '%.s  '
    MIRIFLAGS="${MIRIFLAGS} -Zmiri-compare-exchange-weak-failure-rate=0.0 -Zmiri-preemption-rate=0" \
      cargo miri test --all-features \
      -p crossbeam-deque --doc 2>&1 | ts -i '%.s  '
    ;;
  *)
    echo "unknown crate group '${group}'"
    exit 1
    ;;
esac


================================================
FILE: ci/no_atomic.sh
================================================
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
cd "$(dirname "$0")"/..

# Update the list of targets that do not support atomic/CAS operations.
#
# Usage:
#    ./ci/no_atomic.sh

file=no_atomic.rs

# `"max-atomic-width" == 0` means that atomic is not supported at all.
# We do not have a cfg for targets with {8,16}-bit atomic only, so
# for now we treat them the same as targets that do not support atomic.
# It is not clear exactly what `"max-atomic-width" == null` means, but they
# actually seem to have the same max-atomic-width as the target-pointer-width.
# The targets currently included in this group are "mipsel-sony-psp",
# "thumbv4t-none-eabi", "thumbv6m-none-eabi", all of which are
# `"target-pointer-width" == "32"`, so assuming them `"max-atomic-width" == 32`
# for now.
no_atomic=$(RUSTC_BOOTSTRAP=1 rustc +stable -Z unstable-options --print all-target-specs-json | jq -r '. | to_entries[] | select((.value."max-atomic-width" == 0) or (.value."min-atomic-width" and .value."min-atomic-width" != 8)) | "    \"" + .key + "\","')

cat >"${file}" <<EOF
// This file is @generated by ${0##*/}.
// It is not intended for manual editing.

const NO_ATOMIC: &[&str] = &[
${no_atomic}
];
EOF


================================================
FILE: ci/san.sh
================================================
#!/bin/bash
set -euxo pipefail
IFS=$'\n\t'
cd "$(dirname "$0")"/..

if [[ "${OSTYPE}" != "linux"* ]]; then
  exit 0
fi

export RUSTFLAGS="${RUSTFLAGS:-} --cfg crossbeam_sanitize"

# Run address sanitizer
# TODO: Once `cfg(sanitize = "..")` is stable, replace
# `cfg(crossbeam_sanitize)` with `cfg(sanitize = "..")` and remove
# `--cfg crossbeam_sanitize`.
cargo clean
ASAN_OPTIONS="${ASAN_OPTIONS:-} detect_stack_use_after_return=1" \
  cargo test --all --all-features --release --target x86_64-unknown-linux-gnuasan --tests --exclude benchmarks -- --test-threads=1

ASAN_OPTIONS="${ASAN_OPTIONS:-} detect_stack_use_after_return=1" \
  cargo run \
  --all-features \
  --release \
  --target x86_64-unknown-linux-gnuasan \
  --example sanitize \
  --manifest-path crossbeam-epoch/Cargo.toml

# TODO: Use x86_64-unknown-linux-gnumsan once https://github.com/rust-lang/rust/pull/152757 merged
# Run memory sanitizer
cargo clean
RUSTFLAGS="${RUSTFLAGS:-} -Z sanitizer=memory" \
  cargo test -Z build-std --all --all-features --release --target x86_64-unknown-linux-gnu --tests --exclude benchmarks -- --test-threads=1

# TODO: Use x86_64-unknown-linux-gnutsan once https://github.com/rust-lang/rust/pull/152757 merged
# Run thread sanitizer
cargo clean
TSAN_OPTIONS="${TSAN_OPTIONS:-} suppressions=$(pwd)/ci/tsan" \
RUSTFLAGS="${RUSTFLAGS:-} -Z sanitizer=thread" \
  cargo test -Z build-std --all --all-features --release --target x86_64-unknown-linux-gnu --tests --exclude benchmarks -- --test-threads=1


================================================
FILE: ci/test.sh
================================================
#!/bin/bash
set -euxo pipefail
IFS=$'\n\t'
cd "$(dirname "$0")"/..

# shellcheck disable=SC2086
if [[ -n "${RUST_TARGET:-}" ]]; then
  cargo test --all --all-features --target "${RUST_TARGET}" --exclude benchmarks ${DOCTEST_XCOMPILE:-} -- --test-threads=1
  cargo test --all --all-features --target "${RUST_TARGET}" --exclude benchmarks --release ${DOCTEST_XCOMPILE:-} -- --test-threads=1

  # For now, the non-host target only runs tests.
  exit 0
fi

# Otherwise, run tests and checks with the host target.
cargo test --all --all-features --exclude benchmarks -- --test-threads=1
cargo test --all --all-features --exclude benchmarks --release -- --test-threads=1

if [[ "${RUST_VERSION}" == "nightly"* ]]; then
  # Benchmarks are only checked on nightly because depending on unstable features.
  cargo check --all --all-features --all-targets
fi


================================================
FILE: ci/tsan
================================================
# TSAN suppressions file for crossbeam

# Push and steal operations in crossbeam-deque may cause data races, but such
# data races are safe. If a data race happens, the value read by `steal` is
# forgotten and the steal operation is then retried.
race:crossbeam_deque*push
race:crossbeam_deque*steal

# Non-lock-free AtomicCell uses SeqLock which uses fences.
race:crossbeam_utils::atomic::atomic_cell::atomic_compare_exchange_weak


================================================
FILE: crossbeam-channel/CHANGELOG.md
================================================
# Version 0.5.15

- Fix regression introduced in 0.5.12 that can lead to a double free when dropping unbounded channel. (#1187)

# Version 0.5.14

**Note:** This release has been yanked due to bug fixed in 0.5.15.

- Fix stack overflow when sending large value to unbounded channel. (#1146, #1147)
- Add `Select::new_biased` function. (#1150)
- Remove inefficient spinning. (#1154)
- Suppress buggy `clippy::zero_repeat_side_effects` lint in macro generated code. (#1123)

# Version 0.5.13

**Note:** This release has been yanked due to bug fixed in 0.5.15.

- Add `select_biased!` macro. (#1040)

# Version 0.5.12

**Note:** This release has been yanked due to bug fixed in 0.5.15.

- Fix memory leak in unbounded channel. (#1084)

# Version 0.5.11

- Remove dependency on `cfg-if`. (#1072)

# Version 0.5.10

- Relax the minimum supported Rust version to 1.60. (#1056)
- Optimize `Drop` implementation of bounded channel. (#1057)

# Version 0.5.9

- Bump the minimum supported Rust version to 1.61. (#1037)

# Version 0.5.8

- Fix race condition in unbounded channel. (#972)

# Version 0.5.7

**Note:** This release has been yanked due to bug fixed in 0.5.8.

- Improve handling of very large timeout. (#953)

# Version 0.5.6

**Note:** This release has been yanked due to bug fixed in 0.5.8.

- Bump the minimum supported Rust version to 1.38. (#877)

# Version 0.5.5

**Note:** This release has been yanked due to bug fixed in 0.5.8.

- Replace Spinlock with Mutex. (#835)

# Version 0.5.4

**Note:** This release has been yanked due to bug fixed in 0.5.8.

- Workaround a bug in upstream related to TLS access on AArch64 Linux. (#802)

# Version 0.5.3

**Note:** This release has been yanked. See [#802](https://github.com/crossbeam-rs/crossbeam/issues/802) for details.

- Fix panic on very large timeout. (#798)

# Version 0.5.2

**Note:** This release has been yanked. See [#802](https://github.com/crossbeam-rs/crossbeam/issues/802) for details.

- Fix stacked borrows violations when `-Zmiri-tag-raw-pointers` is enabled. (#763, #764)

# Version 0.5.1

**Note:** This release has been yanked due to bug fixed in 0.5.8.

- Fix memory leak in unbounded channel. (#669)

# Version 0.5.0

- Bump the minimum supported Rust version to 1.36.
- Add `at()` function.
- Add `Sender::send_deadline()` and `Receiver::recv_deadline()` methods.
- Add `Select::select_deadline()` and `Select::ready_deadline()` methods.
- Add `std` (enabled by default) feature for forward compatibility.
- Allow `select!` macro compile with `forbid(unsafe_code)`.

# Version 0.4.4

- Fix bug in release (yanking 0.4.3)
- Fix UB and breaking change introduced in 0.4.3

# Version 0.4.3

**Note:** This release has been yanked. See [GHSA-v5m7-53cv-f3hx](https://github.com/crossbeam-rs/crossbeam/security/advisories/GHSA-v5m7-53cv-f3hx) for details.

- Change license to "MIT OR Apache-2.0".

# Version 0.4.2

- Fix bug in release (yanking 0.4.1)

# Version 0.4.1

- Avoid time drift in `channel::tick`. (#456)
- Fix unsoundness issues by adopting `MaybeUninit`. (#458)

# Version 0.4.0

- Bump the minimum required version to 1.28.
- Bump `crossbeam-utils` to `0.7`.

# Version 0.3.9

- Fix a bug in reference counting.
- Optimize `recv_timeout()`.
- Add `Select::remove()`.
- Various small improvements, code cleanup, more tests.

# Version 0.3.8

- Bump the minimum required version of `crossbeam-utils`.

# Version 0.3.7

- Remove `parking_lot` and `rand` dependencies.
- Expand documentation.
- Implement `Default` for `Select`.
- Make `size_of::<Receiver<T>>()` smaller.
- Several minor optimizations.
- Add more tests.

# Version 0.3.6

- Fix a bug in initialization of unbounded channels.

# Version 0.3.5

- New implementation for unbounded channels.
- A number of small performance improvements.
- Remove `crossbeam-epoch` dependency.

# Version 0.3.4

- Bump `crossbeam-epoch` to `0.7`.
- Improve documentation.

# Version 0.3.3

- Relax the lifetime in `SelectedOperation<'_>`.
- Add `Select::try_ready()`, `Select::ready()`, and `Select::ready_timeout()`.
- Update licensing notices.
- Improve documentation.
- Add methods `is_disconnected()`, `is_timeout()`, `is_empty()`, and `is_full()` on error types.

# Version 0.3.2

- More elaborate licensing notices.

# Version 0.3.1

- Update `crossbeam-utils` to `0.6`.

# Version 0.3.0

- Add a special `never` channel type.
- Dropping all receivers now closes the channel.
- The interface of sending and receiving methods is now very similar to those in v0.1.
- The syntax for `send` in `select!` is now `send(sender, msg) -> res => body`.
- The syntax for `recv` in `select!` is now `recv(receiver) -> res => body`.
- New, more efficient interface for `Select` without callbacks.
- Timeouts can be specified in `select!`.

# Version 0.2.6

- `Select` struct that can add cases dynamically.
- More documentation (in particular, the FAQ section).
- Optimize contended sends/receives in unbounded channels.

# Version 0.2.5

- Use `LocalKey::try_with` instead of `LocalKey::with`.
- Remove helper macros `__crossbeam_channel*`.

# Version 0.2.4

- Make `select!` linearizable with other channel operations.
- Update `crossbeam-utils` to `0.5.0`.
- Update `parking_lot` to `0.6.3`.
- Remove Mac OS X tests.

# Version 0.2.3

- Add Mac OS X tests.
- Lower some memory orderings.
- Eliminate calls to `mem::unitialized`, which caused bugs with ZST.

# Version 0.2.2

- Add more tests.
- Update `crossbeam-epoch` to 0.5.0
- Initialize the RNG seed to a random value.
- Replace `libc::abort` with `std::process::abort`.
- Ignore clippy warnings in `select!`.
- Better interaction of `select!` with the NLL borrow checker.

# Version 0.2.1

- Fix compilation errors when using `select!` with `#[deny(unsafe_code)]`.

# Version 0.2.0

- Implement `IntoIterator<Item = T>` for `Receiver<T>`.
- Add a new `select!` macro.
- Add special channels `after` and `tick`.
- Dropping receivers doesn't close the channel anymore.
- Change the signature of `recv`, `send`, and `try_recv`.
- Remove `Sender::is_closed` and `Receiver::is_closed`.
- Remove `Sender::close` and `Receiver::close`.
- Remove `Sender::send_timeout` and `Receiver::recv_timeout`.
- Remove `Sender::try_send`.
- Remove `Select` and `select_loop!`.
- Remove all error types.
- Remove `Iter`, `TryIter`, and `IntoIter`.
- Remove the `nightly` feature.
- Remove ordering operators for `Sender` and `Receiver`.

# Version 0.1.3

- Add `Sender::disconnect` and `Receiver::disconnect`.
- Implement comparison operators for `Sender` and `Receiver`.
- Allow arbitrary patterns in place of `msg` in `recv(r, msg)`.
- Add a few conversion impls between error types.
- Add benchmarks for `atomicring` and `mpmc`.
- Add benchmarks for different message sizes.
- Documentation improvements.
- Update `crossbeam-epoch` to 0.4.0
- Update `crossbeam-utils` to 0.3.0
- Update `parking_lot` to 0.5
- Update `rand` to 0.4

# Version 0.1.2

- Allow conditional cases in `select_loop!` macro.
- Fix typos in documentation.
- Fix deadlock in selection when all channels are disconnected and a timeout is specified.

# Version 0.1.1

- Implement `Debug` for `Sender`, `Receiver`, `Iter`, `TryIter`, `IntoIter`, and `Select`.
- Implement `Default` for `Select`.

# Version 0.1.0

- First implementation of the channels.
- Add `select_loop!` macro by @TimNN.


================================================
FILE: crossbeam-channel/Cargo.toml
================================================
[package]
name = "crossbeam-channel"
# When publishing a new version:
# - Update CHANGELOG.md
# - Update README.md (when increasing major or minor version)
# - Run './tools/publish.sh crossbeam-channel <version>'
version = "0.5.15"
edition = "2021"
# NB: Sync with msrv badge and "Compatibility" section in README.md
rust-version = "1.74"
license = "MIT OR Apache-2.0"
repository = "https://github.com/crossbeam-rs/crossbeam"
homepage = "https://github.com/crossbeam-rs/crossbeam/tree/master/crossbeam-channel"
description = "Multi-producer multi-consumer channels for message passing"
keywords = ["channel", "mpmc", "select", "golang", "message"]
categories = ["algorithms", "concurrency", "data-structures"]

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[package.metadata.cargo_check_external_types]
# The following are external types that are allowed to be exposed in our public API.
allowed_external_types = [
]

[features]
default = ["std"]

# Enable to use APIs that require `std`.
# This is enabled by default.
#
# NOTE: Disabling `std` feature is not supported yet.
std = ["crossbeam-utils/std"]

[dependencies]
crossbeam-utils = { version = "0.8.18", path = "../crossbeam-utils", default-features = false, features = ["atomic"] }

[dev-dependencies]
fastrand = "2"
rustversion = "1"
signal-hook = "0.4"

[lints]
workspace = true


================================================
FILE: crossbeam-channel/LICENSE-APACHE
================================================
                              Apache License
                        Version 2.0, January 2004
                     http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

   "License" shall mean the terms and conditions for use, reproduction,
   and distribution as defined by Sections 1 through 9 of this document.

   "Licensor" shall mean the copyright owner or entity authorized by
   the copyright owner that is granting the License.

   "Legal Entity" shall mean the union of the acting entity and all
   other entities that control, are controlled by, or are under common
   control with that entity. For the purposes of this definition,
   "control" means (i) the power, direct or indirect, to cause the
   direction or management of such entity, whether by contract or
   otherwise, or (ii) ownership of fifty percent (50%) or more of the
   outstanding shares, or (iii) beneficial ownership of such entity.

   "You" (or "Your") shall mean an individual or Legal Entity
   exercising permissions granted by this License.

   "Source" form shall mean the preferred form for making modifications,
   including but not limited to software source code, documentation
   source, and configuration files.

   "Object" form shall mean any form resulting from mechanical
   transformation or translation of a Source form, including but
   not limited to compiled object code, generated documentation,
   and conversions to other media types.

   "Work" shall mean the work of authorship, whether in Source or
   Object form, made available under the License, as indicated by a
   copyright notice that is included in or attached to the work
   (an example is provided in the Appendix below).

   "Derivative Works" shall mean any work, whether in Source or Object
   form, that is based on (or derived from) the Work and for which the
   editorial revisions, annotations, elaborations, or other modifications
   represent, as a whole, an original work of authorship. For the purposes
   of this License, Derivative Works shall not include works that remain
   separable from, or merely link (or bind by name) to the interfaces of,
   the Work and Derivative Works thereof.

   "Contribution" shall mean any work of authorship, including
   the original version of the Work and any modifications or additions
   to that Work or Derivative Works thereof, that is intentionally
   submitted to Licensor for inclusion in the Work by the copyright owner
   or by an individual or Legal Entity authorized to submit on behalf of
   the copyright owner. For the purposes of this definition, "submitted"
   means any form of electronic, verbal, or written communication sent
   to the Licensor or its representatives, including but not limited to
   communication on electronic mailing lists, source code control systems,
   and issue tracking systems that are managed by, or on behalf of, the
   Licensor for the purpose of discussing and improving the Work, but
   excluding communication that is conspicuously marked or otherwise
   designated in writing by the copyright owner as "Not a Contribution."

   "Contributor" shall mean Licensor and any individual or Legal Entity
   on behalf of whom a Contribution has been received by Licensor and
   subsequently incorporated within the Work.

2. Grant of Copyright License. Subject to the terms and conditions of
   this License, each Contributor hereby grants to You a perpetual,
   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
   copyright license to reproduce, prepare Derivative Works of,
   publicly display, publicly perform, sublicense, and distribute the
   Work and such Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of
   this License, each Contributor hereby grants to You a perpetual,
   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
   (except as stated in this section) patent license to make, have made,
   use, offer to sell, sell, import, and otherwise transfer the Work,
   where such license applies only to those patent claims licensable
   by such Contributor that are necessarily infringed by their
   Contribution(s) alone or by combination of their Contribution(s)
   with the Work to which such Contribution(s) was submitted. If You
   institute patent litigation against any entity (including a
   cross-claim or counterclaim in a lawsuit) alleging that the Work
   or a Contribution incorporated within the Work constitutes direct
   or contributory patent infringement, then any patent licenses
   granted to You under this License for that Work shall terminate
   as of the date such litigation is filed.

4. Redistribution. You may reproduce and distribute copies of the
   Work or Derivative Works thereof in any medium, with or without
   modifications, and in Source or Object form, provided that You
   meet the following conditions:

   (a) You must give any other recipients of the Work or
       Derivative Works a copy of this License; and

   (b) You must cause any modified files to carry prominent notices
       stating that You changed the files; and

   (c) You must retain, in the Source form of any Derivative Works
       that You distribute, all copyright, patent, trademark, and
       attribution notices from the Source form of the Work,
       excluding those notices that do not pertain to any part of
       the Derivative Works; and

   (d) If the Work includes a "NOTICE" text file as part of its
       distribution, then any Derivative Works that You distribute must
       include a readable copy of the attribution notices contained
       within such NOTICE file, excluding those notices that do not
       pertain to any part of the Derivative Works, in at least one
       of the following places: within a NOTICE text file distributed
       as part of the Derivative Works; within the Source form or
       documentation, if provided along with the Derivative Works; or,
       within a display generated by the Derivative Works, if and
       wherever such third-party notices normally appear. The contents
       of the NOTICE file are for informational purposes only and
       do not modify the License. You may add Your own attribution
       notices within Derivative Works that You distribute, alongside
       or as an addendum to the NOTICE text from the Work, provided
       that such additional attribution notices cannot be construed
       as modifying the License.

   You may add Your own copyright statement to Your modifications and
   may provide additional or different license terms and conditions
   for use, reproduction, or distribution of Your modifications, or
   for any such Derivative Works as a whole, provided Your use,
   reproduction, and distribution of the Work otherwise complies with
   the conditions stated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise,
   any Contribution intentionally submitted for inclusion in the Work
   by You to the Licensor shall be under the terms and conditions of
   this License, without any additional terms or conditions.
   Notwithstanding the above, nothing herein shall supersede or modify
   the terms of any separate license agreement you may have executed
   with Licensor regarding such Contributions.

6. Trademarks. This License does not grant permission to use the trade
   names, trademarks, service marks, or product names of the Licensor,
   except as required for reasonable and customary use in describing the
   origin of the Work and reproducing the content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or
   agreed to in writing, Licensor provides the Work (and each
   Contributor provides its Contributions) on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
   implied, including, without limitation, any warranties or conditions
   of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
   PARTICULAR PURPOSE. You are solely responsible for determining the
   appropriateness of using or redistributing the Work and assume any
   risks associated with Your exercise of permissions under this License.

8. Limitation of Liability. In no event and under no legal theory,
   whether in tort (including negligence), contract, or otherwise,
   unless required by applicable law (such as deliberate and grossly
   negligent acts) or agreed to in writing, shall any Contributor be
   liable to You for damages, including any direct, indirect, special,
   incidental, or consequential damages of any character arising as a
   result of this License or out of the use or inability to use the
   Work (including but not limited to damages for loss of goodwill,
   work stoppage, computer failure or malfunction, or any and all
   other commercial damages or losses), even if such Contributor
   has been advised of the possibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing
   the Work or Derivative Works thereof, You may choose to offer,
   and charge a fee for, acceptance of support, warranty, indemnity,
   or other liability obligations and/or rights consistent with this
   License. However, in accepting such obligations, You may act only
   on Your own behalf and on Your sole responsibility, not on behalf
   of any other Contributor, and only if You agree to indemnify,
   defend, and hold each Contributor harmless for any liability
   incurred by, or claims asserted against, such Contributor by reason
   of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

   To apply the Apache License to your work, attach the following
   boilerplate notice, with the fields enclosed by brackets "[]"
   replaced with your own identifying information. (Don't include
   the brackets!)  The text should be enclosed in the appropriate
   comment syntax for the file format. We also recommend that a
   file or class name and description of purpose be included on the
   same "printed page" as the copyright notice for easier
   identification within third-party archives.

Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

	http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


================================================
FILE: crossbeam-channel/LICENSE-MIT
================================================
The MIT License (MIT)

Copyright (c) 2019 The Crossbeam Project Developers

Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the
Software without restriction, including without
limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software
is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice
shall be included in all copies or substantial portions
of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.


================================================
FILE: crossbeam-channel/LICENSE-THIRD-PARTY
================================================
===============================================================================

matching.go
https://creativecommons.org/licenses/by/3.0/legalcode

Creative Commons Legal Code

Attribution 3.0 Unported

    CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
    LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN
    ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
    INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
    REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR
    DAMAGES RESULTING FROM ITS USE.

License

THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE
COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY
COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS
AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.

BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE
TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY
BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS
CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND
CONDITIONS.

1. Definitions

 a. "Adaptation" means a work based upon the Work, or upon the Work and
    other pre-existing works, such as a translation, adaptation,
    derivative work, arrangement of music or other alterations of a
    literary or artistic work, or phonogram or performance and includes
    cinematographic adaptations or any other form in which the Work may be
    recast, transformed, or adapted including in any form recognizably
    derived from the original, except that a work that constitutes a
    Collection will not be considered an Adaptation for the purpose of
    this License. For the avoidance of doubt, where the Work is a musical
    work, performance or phonogram, the synchronization of the Work in
    timed-relation with a moving image ("synching") will be considered an
    Adaptation for the purpose of this License.
 b. "Collection" means a collection of literary or artistic works, such as
    encyclopedias and anthologies, or performances, phonograms or
    broadcasts, or other works or subject matter other than works listed
    in Section 1(f) below, which, by reason of the selection and
    arrangement of their contents, constitute intellectual creations, in
    which the Work is included in its entirety in unmodified form along
    with one or more other contributions, each constituting separate and
    independent works in themselves, which together are assembled into a
    collective whole. A work that constitutes a Collection will not be
    considered an Adaptation (as defined above) for the purposes of this
    License.
 c. "Distribute" means to make available to the public the original and
    copies of the Work or Adaptation, as appropriate, through sale or
    other transfer of ownership.
 d. "Licensor" means the individual, individuals, entity or entities that
    offer(s) the Work under the terms of this License.
 e. "Original Author" means, in the case of a literary or artistic work,
    the individual, individuals, entity or entities who created the Work
    or if no individual or entity can be identified, the publisher; and in
    addition (i) in the case of a performance the actors, singers,
    musicians, dancers, and other persons who act, sing, deliver, declaim,
    play in, interpret or otherwise perform literary or artistic works or
    expressions of folklore; (ii) in the case of a phonogram the producer
    being the person or legal entity who first fixes the sounds of a
    performance or other sounds; and, (iii) in the case of broadcasts, the
    organization that transmits the broadcast.
 f. "Work" means the literary and/or artistic work offered under the terms
    of this License including without limitation any production in the
    literary, scientific and artistic domain, whatever may be the mode or
    form of its expression including digital form, such as a book,
    pamphlet and other writing; a lecture, address, sermon or other work
    of the same nature; a dramatic or dramatico-musical work; a
    choreographic work or entertainment in dumb show; a musical
    composition with or without words; a cinematographic work to which are
    assimilated works expressed by a process analogous to cinematography;
    a work of drawing, painting, architecture, sculpture, engraving or
    lithography; a photographic work to which are assimilated works
    expressed by a process analogous to photography; a work of applied
    art; an illustration, map, plan, sketch or three-dimensional work
    relative to geography, topography, architecture or science; a
    performance; a broadcast; a phonogram; a compilation of data to the
    extent it is protected as a copyrightable work; or a work performed by
    a variety or circus performer to the extent it is not otherwise
    considered a literary or artistic work.
 g. "You" means an individual or entity exercising rights under this
    License who has not previously violated the terms of this License with
    respect to the Work, or who has received express permission from the
    Licensor to exercise rights under this License despite a previous
    violation.
 h. "Publicly Perform" means to perform public recitations of the Work and
    to communicate to the public those public recitations, by any means or
    process, including by wire or wireless means or public digital
    performances; to make available to the public Works in such a way that
    members of the public may access these Works from a place and at a
    place individually chosen by them; to perform the Work to the public
    by any means or process and the communication to the public of the
    performances of the Work, including by public digital performance; to
    broadcast and rebroadcast the Work by any means including signs,
    sounds or images.
 i. "Reproduce" means to make copies of the Work by any means including
    without limitation by sound or visual recordings and the right of
    fixation and reproducing fixations of the Work, including storage of a
    protected performance or phonogram in digital form or other electronic
    medium.

2. Fair Dealing Rights. Nothing in this License is intended to reduce,
limit, or restrict any uses free from copyright or rights arising from
limitations or exceptions that are provided for in connection with the
copyright protection under copyright law or other applicable laws.

3. License Grant. Subject to the terms and conditions of this License,
Licensor hereby grants You a worldwide, royalty-free, non-exclusive,
perpetual (for the duration of the applicable copyright) license to
exercise the rights in the Work as stated below:

 a. to Reproduce the Work, to incorporate the Work into one or more
    Collections, and to Reproduce the Work as incorporated in the
    Collections;
 b. to create and Reproduce Adaptations provided that any such Adaptation,
    including any translation in any medium, takes reasonable steps to
    clearly label, demarcate or otherwise identify that changes were made
    to the original Work. For example, a translation could be marked "The
    original work was translated from English to Spanish," or a
    modification could indicate "The original work has been modified.";
 c. to Distribute and Publicly Perform the Work including as incorporated
    in Collections; and,
 d. to Distribute and Publicly Perform Adaptations.
 e. For the avoidance of doubt:

     i. Non-waivable Compulsory License Schemes. In those jurisdictions in
        which the right to collect royalties through any statutory or
        compulsory licensing scheme cannot be waived, the Licensor
        reserves the exclusive right to collect such royalties for any
        exercise by You of the rights granted under this License;
    ii. Waivable Compulsory License Schemes. In those jurisdictions in
        which the right to collect royalties through any statutory or
        compulsory licensing scheme can be waived, the Licensor waives the
        exclusive right to collect such royalties for any exercise by You
        of the rights granted under this License; and,
   iii. Voluntary License Schemes. The Licensor waives the right to
        collect royalties, whether individually or, in the event that the
        Licensor is a member of a collecting society that administers
        voluntary licensing schemes, via that society, from any exercise
        by You of the rights granted under this License.

The above rights may be exercised in all media and formats whether now
known or hereafter devised. The above rights include the right to make
such modifications as are technically necessary to exercise the rights in
other media and formats. Subject to Section 8(f), all rights not expressly
granted by Licensor are hereby reserved.

4. Restrictions. The license granted in Section 3 above is expressly made
subject to and limited by the following restrictions:

 a. You may Distribute or Publicly Perform the Work only under the terms
    of this License. You must include a copy of, or the Uniform Resource
    Identifier (URI) for, this License with every copy of the Work You
    Distribute or Publicly Perform. You may not offer or impose any terms
    on the Work that restrict the terms of this License or the ability of
    the recipient of the Work to exercise the rights granted to that
    recipient under the terms of the License. You may not sublicense the
    Work. You must keep intact all notices that refer to this License and
    to the disclaimer of warranties with every copy of the Work You
    Distribute or Publicly Perform. When You Distribute or Publicly
    Perform the Work, You may not impose any effective technological
    measures on the Work that restrict the ability of a recipient of the
    Work from You to exercise the rights granted to that recipient under
    the terms of the License. This Section 4(a) applies to the Work as
    incorporated in a Collection, but this does not require the Collection
    apart from the Work itself to be made subject to the terms of this
    License. If You create a Collection, upon notice from any Licensor You
    must, to the extent practicable, remove from the Collection any credit
    as required by Section 4(b), as requested. If You create an
    Adaptation, upon notice from any Licensor You must, to the extent
    practicable, remove from the Adaptation any credit as required by
    Section 4(b), as requested.
 b. If You Distribute, or Publicly Perform the Work or any Adaptations or
    Collections, You must, unless a request has been made pursuant to
    Section 4(a), keep intact all copyright notices for the Work and
    provide, reasonable to the medium or means You are utilizing: (i) the
    name of the Original Author (or pseudonym, if applicable) if supplied,
    and/or if the Original Author and/or Licensor designate another party
    or parties (e.g., a sponsor institute, publishing entity, journal) for
    attribution ("Attribution Parties") in Licensor's copyright notice,
    terms of service or by other reasonable means, the name of such party
    or parties; (ii) the title of the Work if supplied; (iii) to the
    extent reasonably practicable, the URI, if any, that Licensor
    specifies to be associated with the Work, unless such URI does not
    refer to the copyright notice or licensing information for the Work;
    and (iv) , consistent with Section 3(b), in the case of an Adaptation,
    a credit identifying the use of the Work in the Adaptation (e.g.,
    "French translation of the Work by Original Author," or "Screenplay
    based on original Work by Original Author"). The credit required by
    this Section 4 (b) may be implemented in any reasonable manner;
    provided, however, that in the case of a Adaptation or Collection, at
    a minimum such credit will appear, if a credit for all contributing
    authors of the Adaptation or Collection appears, then as part of these
    credits and in a manner at least as prominent as the credits for the
    other contributing authors. For the avoidance of doubt, You may only
    use the credit required by this Section for the purpose of attribution
    in the manner set out above and, by exercising Your rights under this
    License, You may not implicitly or explicitly assert or imply any
    connection with, sponsorship or endorsement by the Original Author,
    Licensor and/or Attribution Parties, as appropriate, of You or Your
    use of the Work, without the separate, express prior written
    permission of the Original Author, Licensor and/or Attribution
    Parties.
 c. Except as otherwise agreed in writing by the Licensor or as may be
    otherwise permitted by applicable law, if You Reproduce, Distribute or
    Publicly Perform the Work either by itself or as part of any
    Adaptations or Collections, You must not distort, mutilate, modify or
    take other derogatory action in relation to the Work which would be
    prejudicial to the Original Author's honor or reputation. Licensor
    agrees that in those jurisdictions (e.g. Japan), in which any exercise
    of the right granted in Section 3(b) of this License (the right to
    make Adaptations) would be deemed to be a distortion, mutilation,
    modification or other derogatory action prejudicial to the Original
    Author's honor and reputation, the Licensor will waive or not assert,
    as appropriate, this Section, to the fullest extent permitted by the
    applicable national law, to enable You to reasonably exercise Your
    right under Section 3(b) of this License (right to make Adaptations)
    but not otherwise.

5. Representations, Warranties and Disclaimer

UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR
OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY
KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE,
INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY,
FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF
LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS,
WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION
OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.

6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE
LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR
ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES
ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

7. Termination

 a. This License and the rights granted hereunder will terminate
    automatically upon any breach by You of the terms of this License.
    Individuals or entities who have received Adaptations or Collections
    from You under this License, however, will not have their licenses
    terminated provided such individuals or entities remain in full
    compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will
    survive any termination of this License.
 b. Subject to the above terms and conditions, the license granted here is
    perpetual (for the duration of the applicable copyright in the Work).
    Notwithstanding the above, Licensor reserves the right to release the
    Work under different license terms or to stop distributing the Work at
    any time; provided, however that any such election will not serve to
    withdraw this License (or any other license that has been, or is
    required to be, granted under the terms of this License), and this
    License will continue in full force and effect unless terminated as
    stated above.

8. Miscellaneous

 a. Each time You Distribute or Publicly Perform the Work or a Collection,
    the Licensor offers to the recipient a license to the Work on the same
    terms and conditions as the license granted to You under this License.
 b. Each time You Distribute or Publicly Perform an Adaptation, Licensor
    offers to the recipient a license to the original Work on the same
    terms and conditions as the license granted to You under this License.
 c. If any provision of this License is invalid or unenforceable under
    applicable law, it shall not affect the validity or enforceability of
    the remainder of the terms of this License, and without further action
    by the parties to this agreement, such provision shall be reformed to
    the minimum extent necessary to make such provision valid and
    enforceable.
 d. No term or provision of this License shall be deemed waived and no
    breach consented to unless such waiver or consent shall be in writing
    and signed by the party to be charged with such waiver or consent.
 e. This License constitutes the entire agreement between the parties with
    respect to the Work licensed here. There are no understandings,
    agreements or representations with respect to the Work not specified
    here. Licensor shall not be bound by any additional provisions that
    may appear in any communication from You. This License may not be
    modified without the mutual written agreement of the Licensor and You.
 f. The rights granted under, and the subject matter referenced, in this
    License were drafted utilizing the terminology of the Berne Convention
    for the Protection of Literary and Artistic Works (as amended on
    September 28, 1979), the Rome Convention of 1961, the WIPO Copyright
    Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996
    and the Universal Copyright Convention (as revised on July 24, 1971).
    These rights and subject matter take effect in the relevant
    jurisdiction in which the License terms are sought to be enforced
    according to the corresponding provisions of the implementation of
    those treaty provisions in the applicable national law. If the
    standard suite of rights granted under applicable copyright law
    includes additional rights not granted under this License, such
    additional rights are deemed to be included in the License; this
    License is not intended to restrict the license of any rights under
    applicable law.


Creative Commons Notice

    Creative Commons is not a party to this License, and makes no warranty
    whatsoever in connection with the Work. Creative Commons will not be
    liable to You or any party on any legal theory for any damages
    whatsoever, including without limitation any general, special,
    incidental or consequential damages arising in connection to this
    license. Notwithstanding the foregoing two (2) sentences, if Creative
    Commons has expressly identified itself as the Licensor hereunder, it
    shall have all rights and obligations of Licensor.

    Except for the limited purpose of indicating to the public that the
    Work is licensed under the CCPL, Creative Commons does not authorize
    the use by either party of the trademark "Creative Commons" or any
    related trademark or logo of Creative Commons without the prior
    written consent of Creative Commons. Any permitted use will be in
    compliance with Creative Commons' then-current trademark usage
    guidelines, as may be published on its website or otherwise made
    available upon request from time to time. For the avoidance of doubt,
    this trademark restriction does not form part of this License.

    Creative Commons may be contacted at https://creativecommons.org/.

===============================================================================

The Go Programming Language
https://golang.org/LICENSE

Copyright (c) 2009 The Go Authors. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

   * Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
   * Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
   * Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

===============================================================================

The Rust Programming Language
https://github.com/rust-lang/rust/blob/master/LICENSE-MIT

Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the
Software without restriction, including without
limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software
is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice
shall be included in all copies or substantial portions
of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

===============================================================================

The Rust Programming Language
https://github.com/rust-lang/rust/blob/master/LICENSE-APACHE

                              Apache License
                        Version 2.0, January 2004
                     http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

   "License" shall mean the terms and conditions for use, reproduction,
   and distribution as defined by Sections 1 through 9 of this document.

   "Licensor" shall mean the copyright owner or entity authorized by
   the copyright owner that is granting the License.

   "Legal Entity" shall mean the union of the acting entity and all
   other entities that control, are controlled by, or are under common
   control with that entity. For the purposes of this definition,
   "control" means (i) the power, direct or indirect, to cause the
   direction or management of such entity, whether by contract or
   otherwise, or (ii) ownership of fifty percent (50%) or more of the
   outstanding shares, or (iii) beneficial ownership of such entity.

   "You" (or "Your") shall mean an individual or Legal Entity
   exercising permissions granted by this License.

   "Source" form shall mean the preferred form for making modifications,
   including but not limited to software source code, documentation
   source, and configuration files.

   "Object" form shall mean any form resulting from mechanical
   transformation or translation of a Source form, including but
   not limited to compiled object code, generated documentation,
   and conversions to other media types.

   "Work" shall mean the work of authorship, whether in Source or
   Object form, made available under the License, as indicated by a
   copyright notice that is included in or attached to the work
   (an example is provided in the Appendix below).

   "Derivative Works" shall mean any work, whether in Source or Object
   form, that is based on (or derived from) the Work and for which the
   editorial revisions, annotations, elaborations, or other modifications
   represent, as a whole, an original work of authorship. For the purposes
   of this License, Derivative Works shall not include works that remain
   separable from, or merely link (or bind by name) to the interfaces of,
   the Work and Derivative Works thereof.

   "Contribution" shall mean any work of authorship, including
   the original version of the Work and any modifications or additions
   to that Work or Derivative Works thereof, that is intentionally
   submitted to Licensor for inclusion in the Work by the copyright owner
   or by an individual or Legal Entity authorized to submit on behalf of
   the copyright owner. For the purposes of this definition, "submitted"
   means any form of electronic, verbal, or written communication sent
   to the Licensor or its representatives, including but not limited to
   communication on electronic mailing lists, source code control systems,
   and issue tracking systems that are managed by, or on behalf of, the
   Licensor for the purpose of discussing and improving the Work, but
   excluding communication that is conspicuously marked or otherwise
   designated in writing by the copyright owner as "Not a Contribution."

   "Contributor" shall mean Licensor and any individual or Legal Entity
   on behalf of whom a Contribution has been received by Licensor and
   subsequently incorporated within the Work.

2. Grant of Copyright License. Subject to the terms and conditions of
   this License, each Contributor hereby grants to You a perpetual,
   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
   copyright license to reproduce, prepare Derivative Works of,
   publicly display, publicly perform, sublicense, and distribute the
   Work and such Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of
   this License, each Contributor hereby grants to You a perpetual,
   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
   (except as stated in this section) patent license to make, have made,
   use, offer to sell, sell, import, and otherwise transfer the Work,
   where such license applies only to those patent claims licensable
   by such Contributor that are necessarily infringed by their
   Contribution(s) alone or by combination of their Contribution(s)
   with the Work to which such Contribution(s) was submitted. If You
   institute patent litigation against any entity (including a
   cross-claim or counterclaim in a lawsuit) alleging that the Work
   or a Contribution incorporated within the Work constitutes direct
   or contributory patent infringement, then any patent licenses
   granted to You under this License for that Work shall terminate
   as of the date such litigation is filed.

4. Redistribution. You may reproduce and distribute copies of the
   Work or Derivative Works thereof in any medium, with or without
   modifications, and in Source or Object form, provided that You
   meet the following conditions:

   (a) You must give any other recipients of the Work or
       Derivative Works a copy of this License; and

   (b) You must cause any modified files to carry prominent notices
       stating that You changed the files; and

   (c) You must retain, in the Source form of any Derivative Works
       that You distribute, all copyright, patent, trademark, and
       attribution notices from the Source form of the Work,
       excluding those notices that do not pertain to any part of
       the Derivative Works; and

   (d) If the Work includes a "NOTICE" text file as part of its
       distribution, then any Derivative Works that You distribute must
       include a readable copy of the attribution notices contained
       within such NOTICE file, excluding those notices that do not
       pertain to any part of the Derivative Works, in at least one
       of the following places: within a NOTICE text file distributed
       as part of the Derivative Works; within the Source form or
       documentation, if provided along with the Derivative Works; or,
       within a display generated by the Derivative Works, if and
       wherever such third-party notices normally appear. The contents
       of the NOTICE file are for informational purposes only and
       do not modify the License. You may add Your own attribution
       notices within Derivative Works that You distribute, alongside
       or as an addendum to the NOTICE text from the Work, provided
       that such additional attribution notices cannot be construed
       as modifying the License.

   You may add Your own copyright statement to Your modifications and
   may provide additional or different license terms and conditions
   for use, reproduction, or distribution of Your modifications, or
   for any such Derivative Works as a whole, provided Your use,
   reproduction, and distribution of the Work otherwise complies with
   the conditions stated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise,
   any Contribution intentionally submitted for inclusion in the Work
   by You to the Licensor shall be under the terms and conditions of
   this License, without any additional terms or conditions.
   Notwithstanding the above, nothing herein shall supersede or modify
   the terms of any separate license agreement you may have executed
   with Licensor regarding such Contributions.

6. Trademarks. This License does not grant permission to use the trade
   names, trademarks, service marks, or product names of the Licensor,
   except as required for reasonable and customary use in describing the
   origin of the Work and reproducing the content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or
   agreed to in writing, Licensor provides the Work (and each
   Contributor provides its Contributions) on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
   implied, including, without limitation, any warranties or conditions
   of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
   PARTICULAR PURPOSE. You are solely responsible for determining the
   appropriateness of using or redistributing the Work and assume any
   risks associated with Your exercise of permissions under this License.

8. Limitation of Liability. In no event and under no legal theory,
   whether in tort (including negligence), contract, or otherwise,
   unless required by applicable law (such as deliberate and grossly
   negligent acts) or agreed to in writing, shall any Contributor be
   liable to You for damages, including any direct, indirect, special,
   incidental, or consequential damages of any character arising as a
   result of this License or out of the use or inability to use the
   Work (including but not limited to damages for loss of goodwill,
   work stoppage, computer failure or malfunction, or any and all
   other commercial damages or losses), even if such Contributor
   has been advised of the possibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing
   the Work or Derivative Works thereof, You may choose to offer,
   and charge a fee for, acceptance of support, warranty, indemnity,
   or other liability obligations and/or rights consistent with this
   License. However, in accepting such obligations, You may act only
   on Your own behalf and on Your sole responsibility, not on behalf
   of any other Contributor, and only if You agree to indemnify,
   defend, and hold each Contributor harmless for any liability
   incurred by, or claims asserted against, such Contributor by reason
   of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

   To apply the Apache License to your work, attach the following
   boilerplate notice, with the fields enclosed by brackets "[]"
   replaced with your own identifying information. (Don't include
   the brackets!)  The text should be enclosed in the appropriate
   comment syntax for the file format. We also recommend that a
   file or class name and description of purpose be included on the
   same "printed page" as the copyright notice for easier
   identification within third-party archives.

Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

	http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


================================================
FILE: crossbeam-channel/README.md
================================================
# Crossbeam Channel

[![Build Status](https://github.com/crossbeam-rs/crossbeam/workflows/CI/badge.svg)](
https://github.com/crossbeam-rs/crossbeam/actions)
[![License](https://img.shields.io/badge/license-MIT_OR_Apache--2.0-blue.svg)](
https://github.com/crossbeam-rs/crossbeam/tree/master/crossbeam-channel#license)
[![Cargo](https://img.shields.io/crates/v/crossbeam-channel.svg)](
https://crates.io/crates/crossbeam-channel)
[![Documentation](https://docs.rs/crossbeam-channel/badge.svg)](
https://docs.rs/crossbeam-channel)
[![Rust 1.74+](https://img.shields.io/badge/rust-1.74+-lightgray.svg)](
https://www.rust-lang.org)
[![chat](https://img.shields.io/discord/569610676205781012.svg?logo=discord)](https://discord.com/invite/JXYwgWZ)

This crate provides multi-producer multi-consumer channels for message passing.
It is an alternative to [`std::sync::mpsc`] with more features and better performance.

Some highlights:

* [`Sender`]s and [`Receiver`]s can be cloned and shared among threads.
* Two main kinds of channels are [`bounded`] and [`unbounded`].
* Convenient extra channels like [`after`], [`never`], and [`tick`].
* The [`select!`] macro can block on multiple channel operations.
* [`Select`] can select over a dynamically built list of channel operations.
* Channels use locks very sparingly for maximum [performance](benchmarks).

[`std::sync::mpsc`]: https://doc.rust-lang.org/std/sync/mpsc/index.html
[`Sender`]: https://docs.rs/crossbeam-channel/latest/crossbeam_channel/struct.Sender.html
[`Receiver`]: https://docs.rs/crossbeam-channel/latest/crossbeam_channel/struct.Receiver.html
[`bounded`]: https://docs.rs/crossbeam-channel/latest/crossbeam_channel/fn.bounded.html
[`unbounded`]: https://docs.rs/crossbeam-channel/latest/crossbeam_channel/fn.unbounded.html
[`after`]: https://docs.rs/crossbeam-channel/latest/crossbeam_channel/fn.after.html
[`never`]: https://docs.rs/crossbeam-channel/latest/crossbeam_channel/fn.never.html
[`tick`]: https://docs.rs/crossbeam-channel/latest/crossbeam_channel/fn.tick.html
[`select!`]: https://docs.rs/crossbeam-channel/latest/crossbeam_channel/macro.select.html
[`Select`]: https://docs.rs/crossbeam-channel/latest/crossbeam_channel/struct.Select.html

## Usage

Add this to your `Cargo.toml`:

```toml
[dependencies]
crossbeam-channel = "0.5"
```

## Compatibility

Crossbeam Channel supports stable Rust releases going back at least six months,
and every time the minimum supported Rust version is increased, a new minor
version is released. Currently, the minimum supported Rust version is 1.74.

## License

Licensed under either of

 * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
 * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)

at your option.

#### Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
dual licensed as above, without any additional terms or conditions.

#### Third party software

This product includes copies and modifications of software developed by third parties:

* [examples/matching.rs](examples/matching.rs) includes
  [matching.go](http://www.nada.kth.se/~snilsson/concurrency/src/matching.go) by Stefan Nilsson,
  licensed under Creative Commons Attribution 3.0 Unported License.

* [tests/mpsc.rs](tests/mpsc.rs) includes modifications of code from The Rust Programming Language,
  licensed under the MIT License and the Apache License, Version 2.0.

* [tests/golang.rs](tests/golang.rs) is based on code from The Go Programming Language, licensed
  under the 3-Clause BSD License.

See the source code files for more details.

Copies of third party licenses can be found in [LICENSE-THIRD-PARTY](LICENSE-THIRD-PARTY).


================================================
FILE: crossbeam-channel/benches/crossbeam.rs
================================================
#![feature(test)]

extern crate test;

use std::num::NonZeroUsize;

use crossbeam_channel::{bounded, unbounded};
use crossbeam_utils::thread::scope;
use test::Bencher;

const TOTAL_STEPS: usize = 40_000;

fn num_cpus() -> usize {
    std::thread::available_parallelism()
        .unwrap_or(NonZeroUsize::MIN)
        .into()
}

mod unbounded {
    use super::*;

    #[bench]
    fn create(b: &mut Bencher) {
        b.iter(unbounded::<i32>);
    }

    #[bench]
    fn oneshot(b: &mut Bencher) {
        b.iter(|| {
            let (s, r) = unbounded::<i32>();
            s.send(0).unwrap();
            r.recv().unwrap();
        });
    }

    #[bench]
    fn inout(b: &mut Bencher) {
        let (s, r) = unbounded::<i32>();
        b.iter(|| {
            s.send(0).unwrap();
            r.recv().unwrap();
        });
    }

    #[bench]
    fn par_inout(b: &mut Bencher) {
        let threads = num_cpus();
        let steps = TOTAL_STEPS / threads;
        let (s, r) = unbounded::<i32>();

        let (s1, r1) = bounded(0);
        let (s2, r2) = bounded(0);
        scope(|scope| {
            for _ in 0..threads {
                scope.spawn(|_| {
                    while r1.recv().is_ok() {
                        for i in 0..steps {
                            s.send(i as i32).unwrap();
                            r.recv().unwrap();
                        }
                        s2.send(()).unwrap();
                    }
                });
            }

            b.iter(|| {
                for _ in 0..threads {
                    s1.send(()).unwrap();
                }
                for _ in 0..threads {
                    r2.recv().unwrap();
                }
            });
            drop(s1);
        })
        .unwrap();
    }

    #[bench]
    fn spsc(b: &mut Bencher) {
        let steps = TOTAL_STEPS;
        let (s, r) = unbounded::<i32>();

        let (s1, r1) = bounded(0);
        let (s2, r2) = bounded(0);
        scope(|scope| {
            scope.spawn(|_| {
                while r1.recv().is_ok() {
                    for i in 0..steps {
                        s.send(i as i32).unwrap();
                    }
                    s2.send(()).unwrap();
                }
            });

            b.iter(|| {
                s1.send(()).unwrap();
                for _ in 0..steps {
                    r.recv().unwrap();
                }
                r2.recv().unwrap();
            });
            drop(s1);
        })
        .unwrap();
    }

    #[bench]
    fn spmc(b: &mut Bencher) {
        let threads = num_cpus() - 1;
        let steps = TOTAL_STEPS / threads;
        let (s, r) = unbounded::<i32>();

        let (s1, r1) = bounded(0);
        let (s2, r2) = bounded(0);
        scope(|scope| {
            for _ in 0..threads {
                scope.spawn(|_| {
                    while r1.recv().is_ok() {
                        for _ in 0..steps {
                            r.recv().unwrap();
                        }
                        s2.send(()).unwrap();
                    }
                });
            }

            b.iter(|| {
                for _ in 0..threads {
                    s1.send(()).unwrap();
                }
                for i in 0..steps * threads {
                    s.send(i as i32).unwrap();
                }
                for _ in 0..threads {
                    r2.recv().unwrap();
                }
            });
            drop(s1);
        })
        .unwrap();
    }

    #[bench]
    fn mpsc(b: &mut Bencher) {
        let threads = num_cpus() - 1;
        let steps = TOTAL_STEPS / threads;
        let (s, r) = unbounded::<i32>();

        let (s1, r1) = bounded(0);
        let (s2, r2) = bounded(0);
        scope(|scope| {
            for _ in 0..threads {
                scope.spawn(|_| {
                    while r1.recv().is_ok() {
                        for i in 0..steps {
                            s.send(i as i32).unwrap();
                        }
                        s2.send(()).unwrap();
                    }
                });
            }

            b.iter(|| {
                for _ in 0..threads {
                    s1.send(()).unwrap();
                }
                for _ in 0..steps * threads {
                    r.recv().unwrap();
                }
                for _ in 0..threads {
                    r2.recv().unwrap();
                }
            });
            drop(s1);
        })
        .unwrap();
    }

    #[bench]
    fn mpmc(b: &mut Bencher) {
        let threads = num_cpus();
        let steps = TOTAL_STEPS / threads;
        let (s, r) = unbounded::<i32>();

        let (s1, r1) = bounded(0);
        let (s2, r2) = bounded(0);
        scope(|scope| {
            for _ in 0..threads / 2 {
                scope.spawn(|_| {
                    while r1.recv().is_ok() {
                        for i in 0..steps {
                            s.send(i as i32).unwrap();
                        }
                        s2.send(()).unwrap();
                    }
                });
            }
            for _ in 0..threads / 2 {
                scope.spawn(|_| {
                    while r1.recv().is_ok() {
                        for _ in 0..steps {
                            r.recv().unwrap();
                        }
                        s2.send(()).unwrap();
                    }
                });
            }

            b.iter(|| {
                for _ in 0..threads {
                    s1.send(()).unwrap();
                }
                for _ in 0..threads {
                    r2.recv().unwrap();
                }
            });
            drop(s1);
        })
        .unwrap();
    }
}

mod bounded_n {
    use super::*;

    #[bench]
    fn spsc(b: &mut Bencher) {
        let steps = TOTAL_STEPS;
        let (s, r) = bounded::<i32>(steps);

        let (s1, r1) = bounded(0);
        let (s2, r2) = bounded(0);
        scope(|scope| {
            scope.spawn(|_| {
                while r1.recv().is_ok() {
                    for i in 0..steps {
                        s.send(i as i32).unwrap();
                    }
                    s2.send(()).unwrap();
                }
            });

            b.iter(|| {
                s1.send(()).unwrap();
                for _ in 0..steps {
                    r.recv().unwrap();
                }
                r2.recv().unwrap();
            });
            drop(s1);
        })
        .unwrap();
    }

    #[bench]
    fn spmc(b: &mut Bencher) {
        let threads = num_cpus() - 1;
        let steps = TOTAL_STEPS / threads;
        let (s, r) = bounded::<i32>(steps * threads);

        let (s1, r1) = bounded(0);
        let (s2, r2) = bounded(0);
        scope(|scope| {
            for _ in 0..threads {
                scope.spawn(|_| {
                    while r1.recv().is_ok() {
                        for _ in 0..steps {
                            r.recv().unwrap();
                        }
                        s2.send(()).unwrap();
                    }
                });
            }

            b.iter(|| {
                for _ in 0..threads {
                    s1.send(()).unwrap();
                }
                for i in 0..steps * threads {
                    s.send(i as i32).unwrap();
                }
                for _ in 0..threads {
                    r2.recv().unwrap();
                }
            });
            drop(s1);
        })
        .unwrap();
    }

    #[bench]
    fn mpsc(b: &mut Bencher) {
        let threads = num_cpus() - 1;
        let steps = TOTAL_STEPS / threads;
        let (s, r) = bounded::<i32>(steps * threads);

        let (s1, r1) = bounded(0);
        let (s2, r2) = bounded(0);
        scope(|scope| {
            for _ in 0..threads {
                scope.spawn(|_| {
                    while r1.recv().is_ok() {
                        for i in 0..steps {
                            s.send(i as i32).unwrap();
                        }
                        s2.send(()).unwrap();
                    }
                });
            }

            b.iter(|| {
                for _ in 0..threads {
                    s1.send(()).unwrap();
                }
                for _ in 0..steps * threads {
                    r.recv().unwrap();
                }
                for _ in 0..threads {
                    r2.recv().unwrap();
                }
            });
            drop(s1);
        })
        .unwrap();
    }

    #[bench]
    fn par_inout(b: &mut Bencher) {
        let threads = num_cpus();
        let steps = TOTAL_STEPS / threads;
        let (s, r) = bounded::<i32>(threads);

        let (s1, r1) = bounded(0);
        let (s2, r2) = bounded(0);
        scope(|scope| {
            for _ in 0..threads {
                scope.spawn(|_| {
                    while r1.recv().is_ok() {
                        for i in 0..steps {
                            s.send(i as i32).unwrap();
                            r.recv().unwrap();
                        }
                        s2.send(()).unwrap();
                    }
                });
            }

            b.iter(|| {
                for _ in 0..threads {
                    s1.send(()).unwrap();
                }
                for _ in 0..threads {
                    r2.recv().unwrap();
                }
            });
            drop(s1);
        })
        .unwrap();
    }

    #[bench]
    fn mpmc(b: &mut Bencher) {
        let threads = num_cpus();
        assert_eq!(threads % 2, 0);
        let steps = TOTAL_STEPS / threads;
        let (s, r) = bounded::<i32>(steps * threads);

        let (s1, r1) = bounded(0);
        let (s2, r2) = bounded(0);
        scope(|scope| {
            for _ in 0..threads / 2 {
                scope.spawn(|_| {
                    while r1.recv().is_ok() {
                        for i in 0..steps {
                            s.send(i as i32).unwrap();
                        }
                        s2.send(()).unwrap();
                    }
                });
            }
            for _ in 0..threads / 2 {
                scope.spawn(|_| {
                    while r1.recv().is_ok() {
                        for _ in 0..steps {
                            r.recv().unwrap();
                        }
                        s2.send(()).unwrap();
                    }
                });
            }

            b.iter(|| {
                for _ in 0..threads {
                    s1.send(()).unwrap();
                }
                for _ in 0..threads {
                    r2.recv().unwrap();
                }
            });
            drop(s1);
        })
        .unwrap();
    }
}

mod bounded_1 {
    use super::*;

    #[bench]
    fn create(b: &mut Bencher) {
        b.iter(|| bounded::<i32>(1));
    }

    #[bench]
    fn oneshot(b: &mut Bencher) {
        b.iter(|| {
            let (s, r) = bounded::<i32>(1);
            s.send(0).unwrap();
            r.recv().unwrap();
        });
    }

    #[bench]
    fn spsc(b: &mut Bencher) {
        let steps = TOTAL_STEPS;
        let (s, r) = bounded::<i32>(1);

        let (s1, r1) = bounded(0);
        let (s2, r2) = bounded(0);
        scope(|scope| {
            scope.spawn(|_| {
                while r1.recv().is_ok() {
                    for i in 0..steps {
                        s.send(i as i32).unwrap();
                    }
                    s2.send(()).unwrap();
                }
            });

            b.iter(|| {
                s1.send(()).unwrap();
                for _ in 0..steps {
                    r.recv().unwrap();
                }
                r2.recv().unwrap();
            });
            drop(s1);
        })
        .unwrap();
    }

    #[bench]
    fn spmc(b: &mut Bencher) {
        let threads = num_cpus() - 1;
        let steps = TOTAL_STEPS / threads;
        let (s, r) = bounded::<i32>(1);

        let (s1, r1) = bounded(0);
        let (s2, r2) = bounded(0);
        scope(|scope| {
            for _ in 0..threads {
                scope.spawn(|_| {
                    while r1.recv().is_ok() {
                        for _ in 0..steps {
                            r.recv().unwrap();
                        }
                        s2.send(()).unwrap();
                    }
                });
            }

            b.iter(|| {
                for _ in 0..threads {
                    s1.send(()).unwrap();
                }
                for i in 0..steps * threads {
                    s.send(i as i32).unwrap();
                }
                for _ in 0..threads {
                    r2.recv().unwrap();
                }
            });
            drop(s1);
        })
        .unwrap();
    }

    #[bench]
    fn mpsc(b: &mut Bencher) {
        let threads = num_cpus() - 1;
        let steps = TOTAL_STEPS / threads;
        let (s, r) = bounded::<i32>(1);

        let (s1, r1) = bounded(0);
        let (s2, r2) = bounded(0);
        scope(|scope| {
            for _ in 0..threads {
                scope.spawn(|_| {
                    while r1.recv().is_ok() {
                        for i in 0..steps {
                            s.send(i as i32).unwrap();
                        }
                        s2.send(()).unwrap();
                    }
                });
            }

            b.iter(|| {
                for _ in 0..threads {
                    s1.send(()).unwrap();
                }
                for _ in 0..steps * threads {
                    r.recv().unwrap();
                }
                for _ in 0..threads {
                    r2.recv().unwrap();
                }
            });
            drop(s1);
        })
        .unwrap();
    }

    #[bench]
    fn mpmc(b: &mut Bencher) {
        let threads = num_cpus();
        let steps = TOTAL_STEPS / threads;
        let (s, r) = bounded::<i32>(1);

        let (s1, r1) = bounded(0);
        let (s2, r2) = bounded(0);
        scope(|scope| {
            for _ in 0..threads / 2 {
                scope.spawn(|_| {
                    while r1.recv().is_ok() {
                        for i in 0..steps {
                            s.send(i as i32).unwrap();
                        }
                        s2.send(()).unwrap();
                    }
                });
            }
            for _ in 0..threads / 2 {
                scope.spawn(|_| {
                    while r1.recv().is_ok() {
                        for _ in 0..steps {
                            r.recv().unwrap();
                        }
                        s2.send(()).unwrap();
                    }
                });
            }

            b.iter(|| {
                for _ in 0..threads {
                    s1.send(()).unwrap();
                }
                for _ in 0..threads {
                    r2.recv().unwrap();
                }
            });
            drop(s1);
        })
        .unwrap();
    }
}

mod bounded_0 {
    use super::*;

    #[bench]
    fn create(b: &mut Bencher) {
        b.iter(|| bounded::<i32>(0));
    }

    #[bench]
    fn spsc(b: &mut Bencher) {
        let steps = TOTAL_STEPS;
        let (s, r) = bounded::<i32>(0);

        let (s1, r1) = bounded(0);
        let (s2, r2) = bounded(0);
        scope(|scope| {
            scope.spawn(|_| {
                while r1.recv().is_ok() {
                    for i in 0..steps {
                        s.send(i as i32).unwrap();
                    }
                    s2.send(()).unwrap();
                }
            });

            b.iter(|| {
                s1.send(()).unwrap();
                for _ in 0..steps {
                    r.recv().unwrap();
                }
                r2.recv().unwrap();
            });
            drop(s1);
        })
        .unwrap();
    }

    #[bench]
    fn spmc(b: &mut Bencher) {
        let threads = num_cpus() - 1;
        let steps = TOTAL_STEPS / threads;
        let (s, r) = bounded::<i32>(0);

        let (s1, r1) = bounded(0);
        let (s2, r2) = bounded(0);
        scope(|scope| {
            for _ in 0..threads {
                scope.spawn(|_| {
                    while r1.recv().is_ok() {
                        for _ in 0..steps {
                            r.recv().unwrap();
                        }
                        s2.send(()).unwrap();
                    }
                });
            }

            b.iter(|| {
                for _ in 0..threads {
                    s1.send(()).unwrap();
                }
                for i in 0..steps * threads {
                    s.send(i as i32).unwrap();
                }
                for _ in 0..threads {
                    r2.recv().unwrap();
                }
            });
            drop(s1);
        })
        .unwrap();
    }

    #[bench]
    fn mpsc(b: &mut Bencher) {
        let threads = num_cpus() - 1;
        let steps = TOTAL_STEPS / threads;
        let (s, r) = bounded::<i32>(0);

        let (s1, r1) = bounded(0);
        let (s2, r2) = bounded(0);
        scope(|scope| {
            for _ in 0..threads {
                scope.spawn(|_| {
                    while r1.recv().is_ok() {
                        for i in 0..steps {
                            s.send(i as i32).unwrap();
                        }
                        s2.send(()).unwrap();
                    }
                });
            }

            b.iter(|| {
                for _ in 0..threads {
                    s1.send(()).unwrap();
                }
                for _ in 0..steps * threads {
                    r.recv().unwrap();
                }
                for _ in 0..threads {
                    r2.recv().unwrap();
                }
            });
            drop(s1);
        })
        .unwrap();
    }

    #[bench]
    fn mpmc(b: &mut Bencher) {
        let threads = num_cpus();
        let steps = TOTAL_STEPS / threads;
        let (s, r) = bounded::<i32>(0);

        let (s1, r1) = bounded(0);
        let (s2, r2) = bounded(0);
        scope(|scope| {
            for _ in 0..threads / 2 {
                scope.spawn(|_| {
                    while r1.recv().is_ok() {
                        for i in 0..steps {
                            s.send(i as i32).unwrap();
                        }
                        s2.send(()).unwrap();
                    }
                });
            }
            for _ in 0..threads / 2 {
                scope.spawn(|_| {
                    while r1.recv().is_ok() {
                        for _ in 0..steps {
                            r.recv().unwrap();
                        }
                        s2.send(()).unwrap();
                    }
                });
            }

            b.iter(|| {
                for _ in 0..threads {
                    s1.send(()).unwrap();
                }
                for _ in 0..threads {
                    r2.recv().unwrap();
                }
            });
            drop(s1);
        })
        .unwrap();
    }
}


================================================
FILE: crossbeam-channel/benchmarks/Cargo.toml
================================================
[package]
name = "benchmarks"
version = "0.0.0"
edition = "2021"
publish = false

[dependencies]
atomicring = "1.2.9"
bus = "2.3.0"
crossbeam = { path = "../.." }
crossbeam-channel = { path = ".." }
crossbeam-deque = { path = "../../crossbeam-deque" }
flume = "0.12"
futures = { version = "0.3", features = ["thread-pool"] }
lockfree = "0.5.1"
mpmc = "0.1.6"

[[bin]]
name = "atomicring"
path = "atomicring.rs"
doc = false

[[bin]]
name = "atomicringqueue"
path = "atomicringqueue.rs"
doc = false

[[bin]]
name = "bus"
path = "bus.rs"
doc = false

[[bin]]
name = "crossbeam-channel"
path = "crossbeam-channel.rs"
doc = false

[[bin]]
name = "crossbeam-deque"
path = "crossbeam-deque.rs"
doc = false

[[bin]]
name = "flume"
path = "flume.rs"
doc = false

[[bin]]
name = "futures-channel"
path = "futures-channel.rs"
doc = false

[[bin]]
name = "lockfree"
path = "lockfree.rs"
doc = false

[[bin]]
name = "mpsc"
path = "mpsc.rs"
doc = false

[[bin]]
name = "segqueue"
path = "segqueue.rs"
doc = false

[[bin]]
name = "mpmc"
path = "mpmc.rs"
doc = false

[lints]
workspace = true


================================================
FILE: crossbeam-channel/benchmarks/README.md
================================================
# Benchmarks

### Tests

* `seq`: A single thread sends `N` messages. Then it receives `N` messages.
* `spsc`: One thread sends `N` messages. Another thread receives `N` messages.
* `mpsc`: `T` threads send `N / T` messages each. One thread receives `N` messages.
* `mpmc`: `T` threads send `N / T` messages each. `T` other threads receive `N / T` messages each.
* `select_rx`: `T` threads send `N / T` messages each into a separate channel. Another thread receives `N` messages by selecting over the `T` channels.
* `select_both`: `T` threads send `N / T` messages each by selecting over `T` channels. `T` other threads receive `N / T` messages each by selecting over the `T` channels.

Default configuration:

- `N = 5000000`
- `T = 4`

### Running

Runs benchmarks, stores results into `*.txt` files, and generates `plot.png`:

```
./run.sh
```

Dependencies:

- Rust 
- Go
- Bash
- Python 
- Matplotlib

### Results

Machine: Intel(R) Core(TM) i7-5500U (2 physical cores, 4 logical cores)

Rust: `rustc 1.63.0 (4b91a6ea7 2022-08-08)`

Go: `go version go1.19 linux/amd64`

Commit: `7070018` (2022-08-24)

![Benchmark results](plot.png)


================================================
FILE: crossbeam-channel/benchmarks/atomicring.rs
================================================
use std::thread;

use atomicring::AtomicRingBuffer;

mod message;

const MESSAGES: usize = 5_000_000;
const THREADS: usize = 4;

fn seq(cap: usize) {
    let q = AtomicRingBuffer::with_capacity(cap);

    for i in 0..MESSAGES {
        loop {
            if q.try_push(message::new(i)).is_ok() {
                break;
            } else {
                thread::yield_now();
            }
        }
    }

    for _ in 0..MESSAGES {
        q.try_pop().unwrap();
    }
}

fn spsc(cap: usize) {
    let q = AtomicRingBuffer::with_capacity(cap);

    crossbeam::scope(|scope| {
        scope.spawn(|_| {
            for i in 0..MESSAGES {
                loop {
                    if q.try_push(message::new(i)).is_ok() {
                        break;
                    } else {
                        thread::yield_now();
                    }
                }
            }
        });

        for _ in 0..MESSAGES {
            loop {
                if q.try_pop().is_none() {
                    thread::yield_now();
                } else {
                    break;
                }
            }
        }
    })
    .unwrap();
}

fn mpsc(cap: usize) {
    let q = AtomicRingBuffer::with_capacity(cap);

    crossbeam::scope(|scope| {
        for _ in 0..THREADS {
            scope.spawn(|_| {
                for i in 0..MESSAGES / THREADS {
                    loop {
                        if q.try_push(message::new(i)).is_ok() {
                            break;
                        } else {
                            thread::yield_now();
                        }
                    }
                }
            });
        }

        for _ in 0..MESSAGES {
            loop {
                if q.try_pop().is_none() {
                    thread::yield_now();
                } else {
                    break;
                }
            }
        }
    })
    .unwrap();
}

fn mpmc(cap: usize) {
    let q = AtomicRingBuffer::with_capacity(cap);

    crossbeam::scope(|scope| {
        for _ in 0..THREADS {
            scope.spawn(|_| {
                for i in 0..MESSAGES / THREADS {
                    loop {
                        if q.try_push(message::new(i)).is_ok() {
                            break;
                        } else {
                            thread::yield_now();
                        }
                    }
                }
            });
        }
        for _ in 0..THREADS {
            scope.spawn(|_| {
                for _ in 0..MESSAGES / THREADS {
                    loop {
                        if q.try_pop().is_none() {
                            thread::yield_now();
                        } else {
                            break;
                        }
                    }
                }
            });
        }
    })
    .unwrap();
}

fn main() {
    macro_rules! run {
        ($name:expr, $f:expr) => {
            let now = ::std::time::Instant::now();
            $f;
            let elapsed = now.elapsed();
            println!(
                "{:25} {:15} {:7.3} sec",
                $name,
                "Rust atomicring",
                elapsed.as_secs() as f64 + elapsed.subsec_nanos() as f64 / 1e9
            );
        };
    }

    run!("bounded_mpmc", mpmc(MESSAGES));
    run!("bounded_mpsc", mpsc(MESSAGES));
    run!("bounded_seq", seq(MESSAGES));
    run!("bounded_spsc", spsc(MESSAGES));
}


================================================
FILE: crossbeam-channel/benchmarks/atomicringqueue.rs
================================================
use std::thread;

use atomicring::AtomicRingQueue;

mod message;

const MESSAGES: usize = 5_000_000;
const THREADS: usize = 4;

fn seq(cap: usize) {
    let q = AtomicRingQueue::with_capacity(cap);

    for i in 0..MESSAGES {
        loop {
            if q.try_push(message::new(i)).is_ok() {
                break;
            } else {
                thread::yield_now();
            }
        }
    }

    for _ in 0..MESSAGES {
        q.pop();
    }
}

fn spsc(cap: usize) {
    let q = AtomicRingQueue::with_capacity(cap);

    crossbeam::scope(|scope| {
        scope.spawn(|_| {
            for i in 0..MESSAGES {
                loop {
                    if q.try_push(message::new(i)).is_ok() {
                        break;
                    } else {
                        thread::yield_now();
                    }
                }
            }
        });

        for _ in 0..MESSAGES {
            q.pop();
        }
    })
    .unwrap();
}

fn mpsc(cap: usize) {
    let q = AtomicRingQueue::with_capacity(cap);

    crossbeam::scope(|scope| {
        for _ in 0..THREADS {
            scope.spawn(|_| {
                for i in 0..MESSAGES / THREADS {
                    loop {
                        if q.try_push(message::new(i)).is_ok() {
                            break;
                        } else {
                            thread::yield_now();
                        }
                    }
                }
            });
        }

        for _ in 0..MESSAGES {
            q.pop();
        }
    })
    .unwrap();
}

fn mpmc(cap: usize) {
    let q = AtomicRingQueue::with_capacity(cap);

    crossbeam::scope(|scope| {
        for _ in 0..THREADS {
            scope.spawn(|_| {
                for i in 0..MESSAGES / THREADS {
                    loop {
                        if q.try_push(message::new(i)).is_ok() {
                            break;
                        } else {
                            thread::yield_now();
                        }
                    }
                }
            });
        }

        for _ in 0..THREADS {
            scope.spawn(|_| {
                for _ in 0..MESSAGES / THREADS {
                    q.pop();
                }
            });
        }
    })
    .unwrap();
}

fn main() {
    macro_rules! run {
        ($name:expr, $f:expr) => {
            let now = ::std::time::Instant::now();
            $f;
            let elapsed = now.elapsed();
            println!(
                "{:25} {:15} {:7.3} sec",
                $name,
                "Rust atomicringqueue",
                elapsed.as_secs() as f64 + elapsed.subsec_nanos() as f64 / 1e9
            );
        };
    }

    run!("bounded_mpmc", mpmc(MESSAGES));
    run!("bounded_mpsc", mpsc(MESSAGES));
    run!("bounded_seq", seq(MESSAGES));
    run!("bounded_spsc", spsc(MESSAGES));
}


================================================
FILE: crossbeam-channel/benchmarks/bus.rs
================================================
use bus::Bus;

mod message;

const MESSAGES: usize = 5_000_000;

fn seq(cap: usize) {
    let mut tx = Bus::new(cap);
    let mut rx = tx.add_rx();

    for i in 0..MESSAGES {
        tx.broadcast(message::new(i));
    }

    for _ in 0..MESSAGES {
        rx.recv().unwrap();
    }
}

fn spsc(cap: usize) {
    let mut tx = Bus::new(cap);
    let mut rx = tx.add_rx();

    crossbeam::scope(|scope| {
        scope.spawn(|_| {
            for i in 0..MESSAGES {
                tx.broadcast(message::new(i));
            }
        });

        for _ in 0..MESSAGES {
            rx.recv().unwrap();
        }
    })
    .unwrap();
}

fn main() {
    macro_rules! run {
        ($name:expr, $f:expr) => {
            let now = ::std::time::Instant::now();
            $f;
            let elapsed = now.elapsed();
            println!(
                "{:25} {:15} {:7.3} sec",
                $name,
                "Rust bus",
                elapsed.as_secs() as f64 + elapsed.subsec_nanos() as f64 / 1e9
            );
        };
    }

    run!("bounded1_spsc", spsc(1));

    run!("bounded_seq", seq(MESSAGES));
    run!("bounded_spsc", spsc(MESSAGES));
}


================================================
FILE: crossbeam-channel/benchmarks/crossbeam-channel.rs
================================================
use crossbeam_channel::{Receiver, Select, Sender, bounded, unbounded};

mod message;

const MESSAGES: usize = 5_000_000;
const THREADS: usize = 4;

fn new<T>(cap: Option<usize>) -> (Sender<T>, Receiver<T>) {
    match cap {
        None => unbounded(),
        Some(cap) => bounded(cap),
    }
}

fn seq(cap: Option<usize>) {
    let (tx, rx) = new(cap);

    for i in 0..MESSAGES {
        tx.send(message::new(i)).unwrap();
    }

    for _ in 0..MESSAGES {
        rx.recv().unwrap();
    }
}

fn spsc(cap: Option<usize>) {
    let (tx, rx) = new(cap);

    crossbeam::scope(|scope| {
        scope.spawn(|_| {
            for i in 0..MESSAGES {
                tx.send(message::new(i)).unwrap();
            }
        });

        for _ in 0..MESSAGES {
            rx.recv().unwrap();
        }
    })
    .unwrap();
}

fn mpsc(cap: Option<usize>) {
    let (tx, rx) = new(cap);

    crossbeam::scope(|scope| {
        for _ in 0..THREADS {
            scope.spawn(|_| {
                for i in 0..MESSAGES / THREADS {
                    tx.send(message::new(i)).unwrap();
                }
            });
        }

        for _ in 0..MESSAGES {
            rx.recv().unwrap();
        }
    })
    .unwrap();
}

fn mpmc(cap: Option<usize>) {
    let (tx, rx) = new(cap);

    crossbeam::scope(|scope| {
        for _ in 0..THREADS {
            scope.spawn(|_| {
                for i in 0..MESSAGES / THREADS {
                    tx.send(message::new(i)).unwrap();
                }
            });
        }

        for _ in 0..THREADS {
            scope.spawn(|_| {
                for _ in 0..MESSAGES / THREADS {
                    rx.recv().unwrap();
                }
            });
        }
    })
    .unwrap();
}

fn select_rx(cap: Option<usize>) {
    let chans = (0..THREADS).map(|_| new(cap)).collect::<Vec<_>>();

    crossbeam::scope(|scope| {
        for (tx, _) in &chans {
            let tx = tx.clone();
            scope.spawn(move |_| {
                for i in 0..MESSAGES / THREADS {
                    tx.send(message::new(i)).unwrap();
                }
            });
        }

        for _ in 0..MESSAGES {
            let mut sel = Select::new();
            for (_, rx) in &chans {
                sel.recv(rx);
            }
            let case = sel.select();
            let index = case.index();
            case.recv(&chans[index].1).unwrap();
        }
    })
    .unwrap();
}

fn select_both(cap: Option<usize>) {
    let chans = (0..THREADS).map(|_| new(cap)).collect::<Vec<_>>();

    crossbeam::scope(|scope| {
        for _ in 0..THREADS {
            scope.spawn(|_| {
                for i in 0..MESSAGES / THREADS {
                    let mut sel = Select::new();
                    for (tx, _) in &chans {
                        sel.send(tx);
                    }
                    let case = sel.select();
                    let index = case.index();
                    case.send(&chans[index].0, message::new(i)).unwrap();
                }
            });
        }

        for _ in 0..THREADS {
            scope.spawn(|_| {
                for _ in 0..MESSAGES / THREADS {
                    let mut sel = Select::new();
                    for (_, rx) in &chans {
                        sel.recv(rx);
                    }
                    let case = sel.select();
                    let index = case.index();
                    case.recv(&chans[index].1).unwrap();
                }
            });
        }
    })
    .unwrap();
}

fn main() {
    macro_rules! run {
        ($name:expr, $f:expr) => {
            let now = ::std::time::Instant::now();
            $f;
            let elapsed = now.elapsed();
            println!(
                "{:25} {:15} {:7.3} sec",
                $name,
                "Rust crossbeam-channel",
                elapsed.as_secs() as f64 + elapsed.subsec_nanos() as f64 / 1e9
            );
        };
    }

    run!("bounded0_mpmc", mpmc(Some(0)));
    run!("bounded0_mpsc", mpsc(Some(0)));
    run!("bounded0_select_both", select_both(Some(0)));
    run!("bounded0_select_rx", select_rx(Some(0)));
    run!("bounded0_spsc", spsc(Some(0)));

    run!("bounded1_mpmc", mpmc(Some(1)));
    run!("bounded1_mpsc", mpsc(Some(1)));
    run!("bounded1_select_both", select_both(Some(1)));
    run!("bounded1_select_rx", select_rx(Some(1)));
    run!("bounded1_spsc", spsc(Some(1)));

    run!("bounded_mpmc", mpmc(Some(MESSAGES)));
    run!("bounded_mpsc", mpsc(Some(MESSAGES)));
    run!("bounded_select_both", select_both(Some(MESSAGES)));
    run!("bounded_select_rx", select_rx(Some(MESSAGES)));
    run!("bounded_seq", seq(Some(MESSAGES)));
    run!("bounded_spsc", spsc(Some(MESSAGES)));

    run!("unbounded_mpmc", mpmc(None));
    run!("unbounded_mpsc", mpsc(None));
    run!("unbounded_select_both", select_both(None));
    run!("unbounded_select_rx", select_rx(None));
    run!("unbounded_seq", seq(None));
    run!("unbounded_spsc", spsc(None));
}


================================================
FILE: crossbeam-channel/benchmarks/crossbeam-deque.rs
================================================
use std::thread;

use crossbeam_deque::{Steal, Worker};

mod message;

const MESSAGES: usize = 5_000_000;

fn seq() {
    let tx = Worker::new_lifo();
    let rx = tx.stealer();

    for i in 0..MESSAGES {
        tx.push(message::new(i));
    }

    for _ in 0..MESSAGES {
        match rx.steal() {
            Steal::Success(_) => {}
            Steal::Retry => panic!(),
            Steal::Empty => panic!(),
        }
    }
}

fn spsc() {
    let tx = Worker::new_lifo();
    let rx = tx.stealer();

    crossbeam::scope(|scope| {
        scope.spawn(move |_| {
            for i in 0..MESSAGES {
                tx.push(message::new(i));
            }
        });

        scope.spawn(move |_| {
            for _ in 0..MESSAGES {
                loop {
                    match rx.steal() {
                        Steal::Success(_) => break,
                        Steal::Retry | Steal::Empty => thread::yield_now(),
                    }
                }
            }
        });
    })
    .unwrap();
}

fn main() {
    macro_rules! run {
        ($name:expr, $f:expr) => {
            let now = ::std::time::Instant::now();
            $f;
            let elapsed = now.elapsed();
            println!(
                "{:25} {:15} {:7.3} sec",
                $name,
                "Rust crossbeam-deque",
                elapsed.as_secs() as f64 + elapsed.subsec_nanos() as f64 / 1e9
            );
        };
    }

    run!("unbounded_seq", seq());
    run!("unbounded_spsc", spsc());
}


================================================
FILE: crossbeam-channel/benchmarks/flume.rs
================================================
mod message;

const MESSAGES: usize = 5_000_000;
const THREADS: usize = 4;

pub fn shuffle<T>(v: &mut [T]) {
    use std::{cell::Cell, num::Wrapping};

    let len = v.len();
    if len <= 1 {
        return;
    }

    thread_local! {
        static RNG: Cell<Wrapping<u32>> = const { Cell::new(Wrapping(1)) };
    }

    RNG.with(|rng| {
        for i in 1..len {
            // This is the 32-bit variant of Xorshift.
            // https://en.wikipedia.org/wiki/Xorshift
            let mut x = rng.get();
            x ^= x << 13;
            x ^= x >> 17;
            x ^= x << 5;
            rng.set(x);

            let x = x.0;
            let n = i + 1;

            // This is a fast alternative to `let j = x % n`.
            // https://lemire.me/blog/2016/06/27/a-fast-alternative-to-the-modulo-reduction/
            let j = ((x as u64).wrapping_mul(n as u64) >> 32) as u32 as usize;

            v.swap(i, j);
        }
    });
}

fn seq_unbounded() {
    let (tx, rx) = flume::unbounded();

    for i in 0..MESSAGES {
        tx.send(message::new(i)).unwrap();
    }

    for _ in 0..MESSAGES {
        rx.recv().unwrap();
    }
}

fn seq_bounded(cap: usize) {
    let (tx, rx) = flume::bounded(cap);

    for i in 0..MESSAGES {
        tx.send(message::new(i)).unwrap();
    }

    for _ in 0..MESSAGES {
        rx.recv().unwrap();
    }
}

fn spsc_unbounded() {
    let (tx, rx) = flume::unbounded();

    crossbeam::scope(|scope| {
        scope.spawn(move |_| {
            for i in 0..MESSAGES {
                tx.send(message::new(i)).unwrap();
            }
        });

        for _ in 0..MESSAGES {
            rx.recv().unwrap();
        }
    })
    .unwrap();
}

fn spsc_bounded(cap: usize) {
    let (tx, rx) = flume::bounded(cap);

    crossbeam::scope(|scope| {
        scope.spawn(move |_| {
            for i in 0..MESSAGES {
                tx.send(message::new(i)).unwrap();
            }
        });

        for _ in 0..MESSAGES {
            rx.recv().unwrap();
        }
    })
    .unwrap();
}

fn mpsc_unbounded() {
    let (tx, rx) = flume::unbounded();

    crossbeam::scope(|scope| {
        for _ in 0..THREADS {
            let tx = tx.clone();
            scope.spawn(move |_| {
                for i in 0..MESSAGES / THREADS {
                    tx.send(message::new(i)).unwrap();
                }
            });
        }

        for _ in 0..MESSAGES {
            rx.recv().unwrap();
        }
    })
    .unwrap();
}

fn mpsc_bounded(cap: usize) {
    let (tx, rx) = flume::bounded(cap);

    crossbeam::scope(|scope| {
        for _ in 0..THREADS {
            let tx = tx.clone();
            scope.spawn(move |_| {
                for i in 0..MESSAGES / THREADS {
                    tx.send(message::new(i)).unwrap();
                }
            });
        }

        for _ in 0..MESSAGES {
            rx.recv().unwrap();
        }
    })
    .unwrap();
}

fn main() {
    macro_rules! run {
        ($name:expr, $f:expr) => {
            let now = ::std::time::Instant::now();
            $f;
            let elapsed = now.elapsed();
            println!(
                "{:25} {:15} {:7.3} sec",
                $name,
                "Rust flume",
                elapsed.as_secs() as f64 + elapsed.subsec_nanos() as f64 / 1e9
            );
        };
    }

    // run!("bounded0_mpsc", mpsc_bounded(0));
    // run!("bounded0_spsc", spsc_bounded(0));

    run!("bounded1_mpsc", mpsc_bounded(1));
    run!("bounded1_spsc", spsc_bounded(1));

    run!("bounded_mpsc", mpsc_bounded(MESSAGES));
    run!("bounded_seq", seq_bounded(MESSAGES));
    run!("bounded_spsc", spsc_bounded(MESSAGES));

    run!("unbounded_mpsc", mpsc_unbounded());
    run!("unbounded_seq", seq_unbounded());
    run!("unbounded_spsc", spsc_unbounded());
}


================================================
FILE: crossbeam-channel/benchmarks/futures-channel.rs
================================================
use futures::{
    SinkExt, StreamExt,
    channel::mpsc,
    executor::{ThreadPool, block_on},
    future, stream,
};

mod message;

const MESSAGES: usize = 5_000_000;
const THREADS: usize = 4;

fn seq_unbounded() {
    block_on(async {
        let (tx, rx) = mpsc::unbounded();
        for i in 0..MESSAGES {
            tx.unbounded_send(message::new(i)).unwrap();
        }
        drop(tx);

        rx.for_each(|_| future::ready(())).await
    });
}

fn seq_bounded(cap: usize) {
    let (mut tx, rx) = mpsc::channel(cap);
    block_on(async {
        for i in 0..MESSAGES {
            tx.try_send(message::new(i)).unwrap();
        }
        drop(tx);

        rx.for_each(|_| future::ready(())).await
    });
}

fn spsc_unbounded() {
    let pool = ThreadPool::new().unwrap();
    block_on(async {
        let (mut tx, rx) = mpsc::unbounded();

        pool.spawn_ok(async move {
            tx.send_all(&mut stream::iter((0..MESSAGES).map(message::new).map(Ok)))
                .await
                .unwrap()
        });

        rx.for_each(|_| future::ready(())).await
    });
}

fn spsc_bounded(cap: usize) {
    let pool = ThreadPool::new().unwrap();
    block_on(async {
        let (mut tx, rx) = mpsc::channel(cap);

        pool.spawn_ok(async move {
            tx.send_all(&mut stream::iter((0..MESSAGES).map(message::new).map(Ok)))
                .await
                .unwrap()
        });

        rx.for_each(|_| future::ready(())).await
    });
}

fn mpsc_unbounded() {
    let pool = ThreadPool::new().unwrap();
    block_on(async {
        let (tx, rx) = mpsc::unbounded();

        for _ in 0..THREADS {
            let mut tx = tx.clone();
            pool.spawn_ok(async move {
                tx.send_all(&mut stream::iter(
                    (0..MESSAGES / THREADS).map(message::new).map(Ok),
                ))
                .await
                .unwrap()
            });
        }
        drop(tx);

        rx.for_each(|_| future::ready(())).await
    });
}

fn mpsc_bounded(cap: usize) {
    let pool = ThreadPool::new().unwrap();
    block_on(async {
        let (tx, rx) = mpsc::channel(cap);

        for _ in 0..THREADS {
            let mut tx = tx.clone();
            pool.spawn_ok(async move {
                tx.send_all(&mut stream::iter(
                    (0..MESSAGES / THREADS).map(message::new).map(Ok),
                ))
                .await
                .unwrap()
            });
        }
        drop(tx);

        rx.for_each(|_| future::ready(())).await
    });
}

fn select_rx_unbounded() {
    let pool = ThreadPool::new().unwrap();
    block_on(async {
        let chans = (0..THREADS).map(|_| mpsc::unbounded()).collect::<Vec<_>>();

        for (tx, _) in &chans {
            let tx = tx.clone();
            pool.spawn_ok(async move {
                for i in 0..MESSAGES / THREADS {
                    tx.unbounded_send(message::new(i)).unwrap();
                }
            });
        }

        stream::select_all(chans.into_iter().map(|(_, rx)| rx))
            .for_each(|_| future::ready(()))
            .await
    });
}

fn select_rx_bounded(cap: usize) {
    let pool = ThreadPool::new().unwrap();
    block_on(async {
        let chans = (0..THREADS).map(|_| mpsc::channel(cap)).collect::<Vec<_>>();

        for (tx, _) in &chans {
            let mut tx = tx.clone();
            pool.spawn_ok(async move {
                tx.send_all(&mut stream::iter(
                    (0..MESSAGES / THREADS).map(message::new).map(Ok),
                ))
                .await
                .unwrap()
            });
        }

        stream::select_all(chans.into_iter().map(|(_, rx)| rx))
            .for_each(|_| future::ready(()))
            .await
    });
}

fn main() {
    macro_rules! run {
        ($name:expr, $f:expr) => {
            let now = ::std::time::Instant::now();
            $f;
            let elapsed = now.elapsed();
            println!(
                "{:25} {:15} {:7.3} sec",
                $name,
                "Rust futures-channel",
                elapsed.as_secs() as f64 + elapsed.subsec_nanos() as f64 / 1e9
            );
        };
    }

    run!("bounded0_mpsc", mpsc_bounded(0));
    run!("bounded0_select_rx", select_rx_bounded(0));
    run!("bounded0_spsc", spsc_bounded(0));

    run!("bounded1_mpsc", mpsc_bounded(1));
    run!("bounded1_select_rx", select_rx_bounded(1));
    run!("bounded1_spsc", spsc_bounded(1));

    run!("bounded_mpsc", mpsc_bounded(MESSAGES));
    run!("bounded_select_rx", select_rx_bounded(MESSAGES));
    run!("bounded_seq", seq_bounded(MESSAGES));
    run!("bounded_spsc", spsc_bounded(MESSAGES));

    run!("unbounded_mpsc", mpsc_unbounded());
    run!("unbounded_select_rx", select_rx_unbounded());
    run!("unbounded_seq", seq_unbounded());
    run!("unbounded_spsc", spsc_unbounded());
}


================================================
FILE: crossbeam-channel/benchmarks/go.go
================================================
package main

import "fmt"
import "time"

const MESSAGES = 5 * 1000 * 1000
const THREADS = 4

type Message = uintptr

func seq(cap int) {
    var c = make(chan Message, cap)

    for i := 0; i < MESSAGES; i++ {
        c <- Message(i)
    }

    for i := 0; i < MESSAGES; i++ {
        <-c
    }
}

func spsc(cap int) {
    var c = make(chan Message, cap)
    var done = make(chan bool)

    go func() {
        for i := 0; i < MESSAGES; i++ {
            c <- Message(i)
        }
        done <- true
    }()

    for i := 0; i < MESSAGES; i++ {
        <-c
    }

    <-done
}

func mpsc(cap int) {
    var c = make(chan Message, cap)
    var done = make(chan bool)

    for t := 0; t < THREADS; t++ {
        go func() {
            for i := 0; i < MESSAGES / THREADS; i++ {
                c <- Message(i)
            }
            done <- true
        }()
    }

    for i := 0; i < MESSAGES; i++ {
        <-c
    }

    for t := 0; t < THREADS; t++ {
        <-done
    }
}

func mpmc(cap int) {
    var c = make(chan Message, cap)
    var done = make(chan bool)

    for t := 0; t < THREADS; t++ {
        go func() {
            for i := 0; i < MESSAGES / THREADS; i++ {
                c <- Message(i)
            }
            done <- true
        }()

    }

    for t := 0; t < THREADS; t++ {
        go func() {
            for i := 0; i < MESSAGES / THREADS; i++ {
                <-c
            }
            done <- true
        }()
    }

    for t := 0; t < THREADS; t++ {
        <-done
        <-done
    }
}

func select_rx(cap int) {
    if THREADS != 4 {
        panic("assumed there are 4 threads")
    }

    var c0 = make(chan Message, cap)
    var c1 = make(chan Message, cap)
    var c2 = make(chan Message, cap)
    var c3 = make(chan Message, cap)
    var done = make(chan bool)

    var producer = func(c chan Message) {
        for i := 0; i < MESSAGES / THREADS; i++ {
            c <- Message(i)
        }
        done <- true
    }
    go producer(c0)
    go producer(c1)
    go producer(c2)
    go producer(c3)

    for i := 0; i < MESSAGES; i++ {
        select {
        case <-c0:
        case <-c1:
        case <-c2:
        case <-c3:
        }
    }

    for t := 0; t < THREADS; t++ {
        <-done
    }
}

func select_both(cap int) {
    if THREADS != 4 {
        panic("assumed there are 4 threads")
    }

    var c0 = make(chan Message, cap)
    var c1 = make(chan Message, cap)
    var c2 = make(chan Message, cap)
    var c3 = make(chan Message, cap)
    var done = make(chan bool)

    var producer = func(c0 chan Message, c1 chan Message, c2 chan Message, c3 chan Message) {
        for i := 0; i < MESSAGES / THREADS; i++ {
            select {
            case c0 <- Message(i):
            case c1 <- Message(i):
            case c2 <- Message(i):
            case c3 <- Message(i):
            }
        }
        done <- true
    }
    go producer(c0,c1,c2,c3)
    go producer(c0,c1,c2,c3)
    go producer(c0,c1,c2,c3)
    go producer(c0,c1,c2,c3)

    for t := 0; t < THREADS; t++ {
        go func() {
            for i := 0; i < MESSAGES / THREADS; i++ {
                select {
                case <-c0:
                case <-c1:
                case <-c2:
                case <-c3:
                }
            }
            done <- true
        }()
    }

    for t := 0; t < THREADS; t++ {
        <-done
        <-done
    }
}

func run(name string, f func(int), cap int) {
    var now = time.Now()
    f(cap)
    var elapsed = time.Now().Sub(now)
    fmt.Printf("%-25v %-15v %7.3f sec\n", name, "Go chan", float64(elapsed) / float64(time.Second))
}

func main() {
    run("bounded0_mpmc", mpmc, 0)
    run("bounded0_mpsc", mpsc, 0)
    run("bounded0_select_both", select_both, 0)
    run("bounded0_select_rx", select_rx, 0)
    run("bounded0_spsc", spsc, 0)

    run("bounded1_mpmc", mpmc, 1)
    run("bounded1_mpsc", mpsc, 1)
    run("bounded1_select_both", select_both, 1)
    run("bounded1_select_rx", select_rx, 1)
    run("bounded1_spsc", spsc, 1)

    run("bounded_mpmc", mpmc, MESSAGES)
    run("bounded_mpsc", mpsc, MESSAGES)
    run("bounded_select_both", select_both, MESSAGES)
    run("bounded_select_rx", select_rx, MESSAGES)
    run("bounded_seq", seq, MESSAGES)
    run("bounded_spsc", spsc, MESSAGES)
}


================================================
FILE: crossbeam-channel/benchmarks/lockfree.rs
================================================
use lockfree::channel;

mod message;

const MESSAGES: usize = 5_000_000;
const THREADS: usize = 4;

use std::thread;

fn seq() {
    let (mut tx, mut rx) = channel::spsc::create();

    for i in 0..MESSAGES {
        tx.send(message::new(i)).unwrap();
    }

    for _ in 0..MESSAGES {
        while rx.recv().is_err() {
            thread::yield_now();
        }
    }
}

fn spsc() {
    let (mut tx, mut rx) = channel::spsc::create();

    crossbeam::scope(|scope| {
        scope.spawn(|_| {
            for i in 0..MESSAGES {
                tx.send(message::new(i)).unwrap();
            }
        });

        for _ in 0..MESSAGES {
            while rx.recv().is_err() {
                thread::yield_now();
            }
        }
    })
    .unwrap();
}

fn mpsc() {
    let (tx, mut rx) = channel::mpsc::create();

    crossbeam::scope(|scope| {
        for _ in 0..THREADS {
            scope.spawn(|_| {
                for i in 0..MESSAGES / THREADS {
                    tx.send(message::new(i)).unwrap();
                }
            });
        }

        for _ in 0..MESSAGES {
            while rx.recv().is_err() {
                thread::yield_now();
            }
        }
    })
    .unwrap();
}

fn mpmc() {
    let (tx, rx) = channel::mpmc::create();

    crossbeam::scope(|scope| {
        for _ in 0..THREADS {
            scope.spawn(|_| {
                for i in 0..MESSAGES / THREADS {
                    tx.send(message::new(i)).unwrap();
                }
            });
        }

        for _ in 0..THREADS {
            scope.spawn(|_| {
                for _ in 0..MESSAGES / THREADS {
                    while rx.recv().is_err() {
                        thread::yield_now();
                    }
                }
            });
        }
    })
    .unwrap();
}

fn main() {
    macro_rules! run {
        ($name:expr, $f:expr) => {
            let now = ::std::time::Instant::now();
            $f;
            let elapsed = now.elapsed();
            println!(
                "{:25} {:15} {:7.3} sec",
                $name,
                "Rust lockfree",
                elapsed.as_secs() as f64 + elapsed.subsec_nanos() as f64 / 1e9
            );
        };
    }

    run!("unbounded_mpmc", mpmc());
    run!("unbounded_mpsc", mpsc());
    run!("unbounded_seq", seq());
    run!("unbounded_spsc", spsc());
}


================================================
FILE: crossbeam-channel/benchmarks/message.rs
================================================
use std::fmt;

const LEN: usize = 1;

#[derive(Clone, Copy)]
pub(crate) struct Message(#[allow(dead_code)] [usize; LEN]);

impl fmt::Debug for Message {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        f.pad("Message")
    }
}

#[inline]
pub(crate) fn new(num: usize) -> Message {
    Message([num; LEN])
}


================================================
FILE: crossbeam-channel/benchmarks/mpmc.rs
================================================
use std::thread;

mod message;

const MESSAGES: usize = 5_000_000;
const THREADS: usize = 4;

fn seq(cap: usize) {
    let q = mpmc::Queue::with_capacity(cap);

    for i in 0..MESSAGES {
        loop {
            if q.push(message::new(i)).is_ok() {
                break;
            } else {
                thread::yield_now();
            }
        }
    }

    for _ in 0..MESSAGES {
        q.pop().unwrap();
    }
}

fn spsc(cap: usize) {
    let q = mpmc::Queue::with_capacity(cap);

    crossbeam::scope(|scope| {
        scope.spawn(|_| {
            for i in 0..MESSAGES {
                loop {
                    if q.push(message::new(i)).is_ok() {
                        break;
                    } else {
                        thread::yield_now();
                    }
                }
            }
        });

        for _ in 0..MESSAGES {
            loop {
                if q.pop().is_none() {
                    thread::yield_now();
                } else {
                    break;
                }
            }
        }
    })
    .unwrap();
}

fn mpsc(cap: usize) {
    let q = mpmc::Queue::with_capacity(cap);

    crossbeam::scope(|scope| {
        for _ in 0..THREADS {
            scope.spawn(|_| {
                for i in 0..MESSAGES / THREADS {
                    loop {
                        if q.push(message::new(i)).is_ok() {
                            break;
                        } else {
                            thread::yield_now();
                        }
                    }
                }
            });
        }

        for _ in 0..MESSAGES {
            loop {
                if q.pop().is_none() {
                    thread::yield_now();
                } else {
                    break;
                }
            }
        }
    })
    .unwrap();
}

fn mpmc(cap: usize) {
    let q = mpmc::Queue::with_capacity(cap);

    crossbeam::scope(|scope| {
        for _ in 0..THREADS {
            scope.spawn(|_| {
                for i in 0..MESSAGES / THREADS {
                    loop {
                        if q.push(message::new(i)).is_ok() {
                            break;
                        } else {
                            thread::yield_now();
                        }
                    }
                }
            });
        }

        for _ in 0..THREADS {
            scope.spawn(|_| {
                for _ in 0..MESSAGES / THREADS {
                    loop {
                        if q.pop().is_none() {
                            thread::yield_now();
                        } else {
                            break;
                        }
                    }
                }
            });
        }
    })
    .unwrap();
}

fn main() {
    macro_rules! run {
        ($name:expr, $f:expr) => {
            let now = ::std::time::Instant::now();
            $f;
            let elapsed = now.elapsed();
            println!(
                "{:25} {:15} {:7.3} sec",
                $name,
                "Rust mpmc",
                elapsed.as_secs() as f64 + elapsed.subsec_nanos() as f64 / 1e9
            );
        };
    }

    run!("bounded_mpmc", mpmc(MESSAGES));
    run!("bounded_mpsc", mpsc(MESSAGES));
    run!("bounded_seq", seq(MESSAGES));
    run!("bounded_spsc", spsc(MESSAGES));
}


================================================
FILE: crossbeam-channel/benchmarks/mpsc.rs
================================================
use std::sync::mpsc;

mod message;

const MESSAGES: usize = 5_000_000;
const THREADS: usize = 4;

pub fn shuffle<T>(v: &mut [T]) {
    use std::{cell::Cell, num::Wrapping};

    let len = v.len();
    if len <= 1 {
        return;
    }

    thread_local! {
        static RNG: Cell<Wrapping<u32>> = const { Cell::new(Wrapping(1)) };
    }

    RNG.with(|rng| {
        for i in 1..len {
            // This is the 32-bit variant of Xorshift.
            // https://en.wikipedia.org/wiki/Xorshift
            let mut x = rng.get();
            x ^= x << 13;
            x ^= x >> 17;
            x ^= x << 5;
            rng.set(x);

            let x = x.0;
            let n = i + 1;

            // This is a fast alternative to `let j = x % n`.
            // https://lemire.me/blog/2016/06/27/a-fast-alternative-to-the-modulo-reduction/
            let j = ((x as u64).wrapping_mul(n as u64) >> 32) as u32 as usize;

            v.swap(i, j);
        }
    });
}

fn seq_async() {
    let (tx, rx) = mpsc::channel();

    for i in 0..MESSAGES {
        tx.send(message::new(i)).unwrap();
    }

    for _ in 0..MESSAGES {
        rx.recv().unwrap();
    }
}

fn seq_sync(cap: usize) {
    let (tx, rx) = mpsc::sync_channel(cap);

    for i in 0..MESSAGES {
        tx.send(message::new(i)).unwrap();
    }

    for _ in 0..MESSAGES {
        rx.recv().unwrap();
    }
}

fn spsc_async() {
    let (tx, rx) = mpsc::channel();

    crossbeam::scope(|scope| {
        scope.spawn(move |_| {
            for i in 0..MESSAGES {
                tx.send(message::new(i)).unwrap();
            }
        });

        for _ in 0..MESSAGES {
            rx.recv().unwrap();
        }
    })
    .unwrap();
}

fn spsc_sync(cap: usize) {
    let (tx, rx) = mpsc::sync_channel(cap);

    crossbeam::scope(|scope| {
        scope.spawn(move |_| {
            for i in 0..MESSAGES {
                tx.send(message::new(i)).unwrap();
            }
        });

        for _ in 0..MESSAGES {
            rx.recv().unwrap();
        }
    })
    .unwrap();
}

fn mpsc_async() {
    let (tx, rx) = mpsc::channel();

    crossbeam::scope(|scope| {
        for _ in 0..THREADS {
            let tx = tx.clone();
            scope.spawn(move |_| {
                for i in 0..MESSAGES / THREADS {
                    tx.send(message::new(i)).unwrap();
                }
            });
        }

        for _ in 0..MESSAGES {
            rx.recv().unwrap();
        }
    })
    .unwrap();
}

fn mpsc_sync(cap: usize) {
    let (tx, rx) = mpsc::sync_channel(cap);

    crossbeam::scope(|scope| {
        for _ in 0..THREADS {
            let tx = tx.clone();
            scope.spawn(move |_| {
                for i in 0..MESSAGES / THREADS {
                    tx.send(message::new(i)).unwrap();
                }
            });
        }

        for _ in 0..MESSAGES {
            rx.recv().unwrap();
        }
    })
    .unwrap();
}

fn main() {
    macro_rules! run {
        ($name:expr, $f:expr) => {
            let now = ::std::time::Instant::now();
            $f;
            let elapsed = now.elapsed();
            println!(
                "{:25} {:15} {:7.3} sec",
                $name,
                "Rust mpsc",
                elapsed.as_secs() as f64 + elapsed.subsec_nanos() as f64 / 1e9
            );
        };
    }

    run!("bounded0_mpsc", mpsc_sync(0));
    run!("bounded0_spsc", spsc_sync(0));

    run!("bounded1_mpsc", mpsc_sync(1));
    run!("bounded1_spsc", spsc_sync(1));

    run!("bounded_mpsc", mpsc_sync(MESSAGES));
    run!("bounded_seq", seq_sync(MESSAGES));
    run!("bounded_spsc", spsc_sync(MESSAGES));

    run!("unbounded_mpsc", mpsc_async());
    run!("unbounded_seq", seq_async());
    run!("unbounded_spsc", spsc_async());
}


================================================
FILE: crossbeam-channel/benchmarks/plot.py
================================================
#!/usr/bin/env python3
import random
import sys
import matplotlib.pyplot as plt


def read_data(files):
    results = []
    for f in files:
        with open(f) as f:
            for line in f.readlines():
                test, lang, impl, secs, _ = line.split()
                splt = test.split('_')
                results.append((splt[0], '_'.join(splt[1:]), lang, impl, float(secs)))
    return results


def get_runs(results, prefix):
    runs = set()
    for pre, test, lang, impl, secs in results:
        if pre == prefix:
            runs.add(test)
    result = list(runs)
    result.sort()
    return result


def find(s, x):
    for i in range(len(s)):
        if s[i] == x:
            return i
    return None


color_set = {
    'aqua': '#00ffff',
    'azure': '#f0ffff',
    'beige': '#f5f5dc',
    'black': '#000000',
    'blue': '#0000ff',
    'brown': '#a52a2a',
    'cyan': '#00ffff',
    'darkblue': '#00008b',
    'darkcyan': '#008b8b',
    'darkgrey': '#a9a9a9',
    'darkgreen': '#006400',
    'darkkhaki': '#bdb76b',
    'darkmagenta': '#8b008b',
    'darkolivegreen': '#556b2f',
    'darkorange': '#ff8c00',
    'darkorchid': '#9932cc',
    'darkred': '#8b0000',
    'darksalmon': '#e9967a',
    'darkviolet': '#9400d3',
    'fuchsia': '#ff00ff',
    'gold': '#ffd700',
    'green': '#008000',
    'indigo': '#4b0082',
    'khaki': '#f0e68c',
    'lightblue': '#add8e6',
    'lightcyan': '#e0ffff',
    'lightgreen': '#90ee90',
    'lightgrey': '#d3d3d3',
    'lightpink': '#ffb6c1',
    'lightyellow': '#ffffe0',
    'lime': '#00ff00',
    'magenta': '#ff00ff',
    'maroon': '#800000',
    'navy': '#000080',
    'olive': '#808000',
    'orange': '#ffa500',
    'pink': '#ffc0cb',
    'purple': '#800080',
    'red': '#ff0000',
}
saved_color = {}


def get_color(name):
    if name not in saved_color:
        color = color_set.popitem()
        saved_color[name] = color
    return saved_color[name][1]


def plot(results, fig, subplot, title, prefix):
    runs = get_runs(results, prefix)

    ys = [len(runs) * (i + 1) for i in range(len(runs))]

    ax = fig.add_subplot(subplot)
    ax.set_title(title)
    ax.set_yticks(ys)
    ax.set_yticklabels(runs)
    ax.tick_params(which='major', length=0)
    ax.set_xlabel('seconds')

    scores = {}

    for pre, test, lang, impl, secs in results:
        if pre == prefix:
            name = impl if lang == 'Rust' else impl + f' ({lang})'
            if name not in scores:
                scores[name] = [0] * len(runs)
            scores[name][find(runs, test)] = secs

    opts = dict(height=0.8, align='center')
    x_max = max(max(scores.values(), key=lambda x: max(x)))
    for i, (name, score) in enumerate(scores.items()):
        yy = [y + i - len(runs) // 2 + 0.2 for y in ys]
        ax.barh(yy, score, color=get_color(name), **opts)
        for xxx, yyy in zip(score, yy):
            if xxx:
                ax.text(min(x_max - len(name) * 0.018 * x_max, xxx), yyy - 0.25, name, fontsize=9)


def plot_all(results, descriptions, labels):
    fig = plt.figure(figsize=(10, 10))
    # TODO support more subplots
    subplot = [221, 222, 223, 224]
    for p, d, l in zip(subplot, descriptions, labels):
        plot(results, fig, p, d, l)
    plt.subplots_adjust(
        top=0.95,
        bottom=0.05,
        left=0.1,
        right=0.95,
        wspace=0.3,
        hspace=0.2,
    )
    plt.savefig('plot.png')
    # plt.show()


def main():
    results = read_data(sys.argv[1:])
    descriptions = [
        'Bounded channel of capacity 0',
        'Bounded channel of capacity 1',
        'Bounded channel of capacity N',
        'Unbounded channel',
    ]
    labels = ['bounded0', 'bounded1', 'bounded', 'unbounded']
    plot_all(results, descriptions, labels)


if __name__ == '__main__':
    main()


================================================
FILE: crossbeam-channel/benchmarks/run.sh
================================================
#!/bin/bash
set -euxo pipefail
IFS=$'\n\t'
cd "$(dirname "$0")"

cargo run --release --bin crossbeam-channel | tee crossbeam-channel.txt
cargo run --release --bin futures-channel | tee futures-channel.txt
cargo run --release --bin mpsc | tee mpsc.txt
cargo run --release --bin flume | tee flume.txt
go run go.go | tee go.txt

# These can also be run, but too many plot bars mess
# up the plot (they start to overlap). So only 5 contenders
# with the most tests are included by default.

# cargo run --release --bin atomicringqueue | tee atomicringqueue.txt
# cargo run --release --bin atomicring | tee atomicring.txt
# cargo run --release --bin bus | tee bus.txt
# cargo run --release --bin crossbeam-deque | tee crossbeam-deque.txt
# cargo run --release --bin lockfree | tee lockfree.txt
# cargo run --release --bin segqueue | tee segqueue.txt
# cargo run --release --bin mpmc | tee mpmc.txt

./plot.py ./*.txt


================================================
FILE: crossbeam-channel/benchmarks/segqueue.rs
================================================
use std::thread;

use crossbeam::queue::SegQueue;

mod message;

const MESSAGES: usize = 5_000_000;
const THREADS: usize = 4;

fn seq() {
    let q = SegQueue::new();

    for i in 0..MESSAGES {
        q.push(message::new(i));
    }

    for _ in 0..MESSAGES {
        q.pop().unwrap();
    }
}

fn spsc() {
    let q = SegQueue::new();

    crossbeam::scope(|scope| {
        scope.spawn(|_| {
            for i in 0..MESSAGES {
                q.push(message::new(i));
            }
        });

        for _ in 0..MESSAGES {
            loop {
                if q.pop().is_none() {
                    thread::yield_now();
                } else {
                    break;
                }
            }
        }
    })
    .unwrap();
}

fn mpsc() {
    let q = SegQueue::new();

    crossbeam::scope(|scope| {
        for _ in 0..THREADS {
            scope.spawn(|_| {
                for i in 0..MESSAGES / THREADS {
                    q.push(message::new(i));
                }
            });
        }

        for _ in 0..MESSAGES {
            loop {
                if q.pop().is_none() {
                    thread::yield_now();
                } else {
                    break;
                }
            }
        }
    })
    .unwrap();
}

fn mpmc() {
    let q = SegQueue::new();

    crossbeam::scope(|scope| {
        for _ in 0..THREADS {
            scope.spawn(|_| {
                for i in 0..MESSAGES / THREADS {
                    q.push(message::new(i));
                }
            });
        }

        for _ in 0..THREADS {
            scope.spawn(|_| {
                for _ in 0..MESSAGES / THREADS {
                    loop {
                        if q.pop().is_none() {
                            thread::yield_now();
                        } else {
                            break;
                        }
                    }
                }
            });
        }
    })
    .unwrap();
}

fn main() {
    macro_rules! run {
        ($name:expr, $f:expr) => {
            let now = ::std::time::Instant::now();
            $f;
            let elapsed = now.elapsed();
            println!(
                "{:25} {:15} {:7.3} sec",
                $name,
                "Rust segqueue",
                elapsed.as_secs() as f64 + elapsed.subsec_nanos() as f64 / 1e9
            );
        };
    }

    run!("unbounded_mpmc", mpmc());
    run!("unbounded_mpsc", mpsc());
    run!("unbounded_seq", seq());
    run!("unbounded_spsc", spsc());
}


================================================
FILE: crossbeam-channel/examples/fibonacci.rs
================================================
//! An asynchronous fibonacci sequence generator.

use std::thread;

use crossbeam_channel::{Sender, bounded};

// Sends the Fibonacci sequence into the channel until it becomes disconnected.
fn fibonacci(sender: Sender<u64>) {
    let (mut x, mut y) = (0, 1);
    while sender.send(x).is_ok() {
        let tmp = x;
        x = y;
        y += tmp;
    }
}

fn main() {
    let (s, r) = bounded(0);
    thread::spawn(|| fibonacci(s));

    // Print the first 20 Fibonacci numbers.
    for num in r.iter().take(20) {
        println!("{}", num);
    }
}


================================================
FILE: crossbeam-channel/examples/matching.rs
================================================
//! Using `select!` to send and receive on the same channel at the same time.
//!
//! This example is based on the following program in Go.
//!
//! Source:
//!   - https://web.archive.org/web/20171209034309/https://www.nada.kth.se/~snilsson/concurrency
//!   - http://www.nada.kth.se/~snilsson/concurrency/src/matching.go
//!
//! Copyright & License:
//!   - Stefan Nilsson
//!   - Creative Commons Attribution 3.0 Unported License
//!   - https://creativecommons.org/licenses/by/3.0/
//!
//! ```go
//! func main() {
//!     people := []string{"Anna", "Bob", "Cody", "Dave", "Eva"}
//!     match := make(chan string, 1) // Make room for one unmatched send.
//!     wg := new(sync.WaitGroup)
//!     for _, name := range people {
//!         wg.Add(1)
//!         go Seek(name, match, wg)
//!     }
//!     wg.Wait()
//!     select {
//!     case name := <-match:
//!         fmt.Printf("No one received %s’s message.\n", name)
//!     default:
//!         // There was no pending send operation.
//!     }
//! }
//!
//! // Seek either sends or receives, whichever possible, a name on the match
//! // channel and notifies the wait group when done.
//! func Seek(name string, match chan string, wg *sync.WaitGroup) {
//!     select {
//!     case peer := <-match:
//!         fmt.Printf("%s received a message from %s.\n", name, peer)
//!     case match <- name:
//!         // Wait for someone to receive my message.
//!     }
//!     wg.Done()
//! }
//! ```

use crossbeam_channel::{bounded, select};
use crossbeam_utils::thread;

fn main() {
    let people = vec!["Anna", "Bob", "Cody", "Dave", "Eva"];
    let (s, r) = bounded(1); // Make room for one unmatched send.

    // Either send my name into the channel or receive someone else's, whatever happens first.
    let seek = |name, s, r| {
        select! {
            recv(r) -> peer => println!("{} received a message from {}.", name, peer.unwrap()),
            send(s, name) -> _ => {}, // Wait for someone to receive my message.
        }
    };

    thread::scope(|scope| {
        for name in people {
            let (s, r) = (s.clone(), r.clone());
            scope.spawn(move |_| seek(name, s, r));
        }
    })
    .unwrap();

    // Check if there is a pending send operation.
    if let Ok(name) = r.try_recv() {
        println!("No one received {}’s message.", name);
    }
}


================================================
FILE: crossbeam-channel/examples/stopwatch.rs
================================================
//! Prints the elapsed time every 1 second and quits on Ctrl+C.

#[cfg(windows)] // signal_hook::iterator does not work on windows
fn main() {
    println!("This example does not work on Windows");
}

#[cfg(not(windows))]
fn main() {
    use std::{
        io, thread,
        time::{Duration, Instant},
    };

    use crossbeam_channel::{Receiver, bounded, select, tick};
    use signal_hook::{consts::SIGINT, iterator::Signals};

    // Creates a channel that gets a message every time `SIGINT` is signalled.
    fn sigint_notifier() -> io::Result<Receiver<()>> {
        let (s, r) = bounded(100);
        let mut signals = Signals::new([SIGINT])?;

        thread::spawn(move || {
            for _ in signals.forever() {
                if s.send(()).is_err() {
                    break;
                }
            }
        });

        Ok(r)
    }

    // Prints the elapsed time.
    fn show(dur: Duration) {
        println!("Elapsed: {}.{:03} sec", dur.as_secs(), dur.subsec_millis());
    }

    let start = Instant::now();
    let update = tick(Duration::from_secs(1));
    let ctrl_c = sigint_notifier().unwrap();

    loop {
        select! {
            recv(update) -> _ => {
                show(start.elapsed());
            }
            recv(ctrl_c) -> _ => {
                println!();
                println!("Goodbye!");
                show(start.elapsed());
                break;
            }
        }
    }
}


================================================
FILE: crossbeam-channel/src/channel.rs
================================================
//! The channel interface.

use alloc::sync::Arc;
use core::{
    fmt,
    iter::FusedIterator,
    mem,
    panic::{RefUnwindSafe, UnwindSafe},
    time::Duration,
};
use std::time::Instant;

use crate::{
    context::Context,
    counter,
    err::{RecvError, RecvTimeoutError, SendError, SendTimeoutError, TryRecvError, TrySendError},
    flavors,
    select::{Operation, SelectHandle, Token},
};

/// Creates a multi-producer multi-consumer channel of unbounded capacity.
///
/// This channel has a growable buffer that can hold any number of messages at a time.
///
/// For more info on how to use the channel see [module level documentation](index.html).
///
/// # Examples
///
/// ```
/// use std::thread;
/// use crossbeam_channel::unbounded;
///
/// let (s, r) = unbounded();
///
/// // Computes the n-th Fibonacci number.
/// fn fib(n: i32) -> i32 {
///     if n <= 1 {
///         n
///     } else {
///         fib(n - 1) + fib(n - 2)
///     }
/// }
///
/// // Spawn an asynchronous computation.
/// thread::spawn(move || s.send(fib(20)).unwrap());
///
/// // Print the result of the computation.
/// println!("{}", r.recv().unwrap());
/// ```
pub fn unbounded<T>() -> (Sender<T>, Receiver<T>) {
    let (s, r) = counter::new(flavors::list::Channel::new());
    let s = Sender {
        flavor: SenderFlavor::List(s),
    };
    let r = Receiver {
        flavor: ReceiverFlavor::List(r),
    };
    (s, r)
}

/// Creates a multi-producer multi-consumer channel of bounded capacity.
///
/// This channel has a buffer that can hold at most `cap` messages at a time.
///
/// A special case is zero-capacity channel, which cannot hold any messages. Instead, send and
/// receive operations must appear at the same time in order to pair up and pass the message over.
///
/// For more info on how to use the channel see [module level documentation](index.html).
///
/// # Examples
///
/// A channel of capacity 1:
///
/// ```
/// use std::thread;
/// use std::time::Duration;
/// use crossbeam_channel::bounded;
///
/// let (s, r) = bounded(1);
///
/// // This call returns immediately because there is enough space in the channel.
/// s.send(1).unwrap();
///
/// thread::spawn(move || {
///     // This call blocks the current thread because the channel is full.
///     // It will be able to complete only after the first message is received.
///     s.send(2).unwrap();
/// });
///
/// thread::sleep(Duration::from_secs(1));
/// assert_eq!(r.recv(), Ok(1));
/// assert_eq!(r.recv(), Ok(2));
/// ```
///
/// A zero-capacity channel:
///
/// ```
/// use std::thread;
/// use std::time::Duration;
/// use crossbeam_channel::bounded;
///
/// let (s, r) = bounded(0);
///
/// thread::spawn(move || {
///     // This call blocks the current thread until a receive operation appears
///     // on the other side of the channel.
///     s.send(1).unwrap();
/// });
///
/// thread::sleep(Duration::from_secs(1));
/// assert_eq!(r.recv(), Ok(1));
/// ```
pub fn bounded<T>(cap: usize) -> (Sender<T>, Receiver<T>) {
    if cap == 0 {
        let (s, r) = counter::new(flavors::zero::Channel::new());
        let s = Sender {
            flavor: SenderFlavor::Zero(s),
        };
        let r = Receiver {
            flavor: ReceiverFlavor::Zero(r),
        };
        (s, r)
    } else {
        let (s, r) = counter::new(flavors::array::Channel::with_capacity(cap));
        let s = Sender {
            flavor: SenderFlavor::Array(s),
        };
        let r = Receiver {
            flavor: ReceiverFlavor::Array(r),
        };
        (s, r)
    }
}

/// Creates a receiver that delivers a message after a certain duration of time.
///
/// The channel is bounded with capacity of 1 and never gets disconnected. Exactly one message will
/// be sent into the channel after `duration` elapses. The message is the instant at which it is
/// sent.
///
/// # Examples
///
/// Using an `after` channel for timeouts:
///
/// ```
/// use std::time::Duration;
/// use crossbeam_channel::{after, select, unbounded};
///
/// let (s, r) = unbounded::<i32>();
/// let timeout = Duration::from_millis(100);
///
/// select! {
///     recv(r) -> msg => println!("received {:?}", msg),
///     recv(after(timeout)) -> _ => println!("timed out"),
/// }
/// ```
///
/// When the message gets sent:
///
/// ```
/// # if cfg!(gha_macos_runner) { return; } // GitHub-hosted macOS runner is slow
/// use std::thread;
/// use std::time::{Duration, Instant};
/// use crossbeam_channel::after;
///
/// // Converts a number of milliseconds into a `Duration`.
/// let ms = |ms| Duration::from_millis(ms);
///
/// // Returns `true` if `a` and `b` are very close `Instant`s.
/// let eq = |a, b| a + ms(60) > b && b + ms(60) > a;
///
/// let start = Instant::now();
/// let r = after(ms(100));
///
/// thread::sleep(ms(500));
///
/// // This message was sent 100 ms from the start and received 500 ms from the start.
/// assert!(eq(r.recv().unwrap(), start + ms(100)));
/// assert!(eq(Instant::now(), start + ms(500)));
/// ```
pub fn after(duration: Duration) -> Receiver<Instant> {
    match Instant::now().checked_add(duration) {
        Some(deadline) => Receiver {
            flavor: ReceiverFlavor::At(Arc::new(flavors::at::Channel::new_deadline(deadline))),
        },
        None => never(),
    }
}

/// Creates a receiver that delivers a message at a certain instant in time.
///
/// The channel is bounded with capacity of 1 and never gets disconnected. Exactly one message will
/// be sent into the channel at the moment in time `when`. The message is the instant at which it
/// is sent, which is the same as `when`. If `when` is in the past, the message will be delivered
/// instantly to the receiver.
///
/// # Examples
///
/// Using an `at` channel for timeouts:
///
/// ```
/// use std::time::{Instant, Duration};
/// use crossbeam_channel::{at, select, unbounded};
///
/// let (s, r) = unbounded::<i32>();
/// let deadline = Instant::now() + Duration::from_millis(500);
///
/// select! {
///     recv(r) -> msg => println!("received {:?}", msg),
///     recv(at(deadline)) -> _ => println!("timed out"),
/// }
/// ```
///
/// When the message gets sent:
///
/// ```
/// use std::time::{Duration, Instant};
/// use crossbeam_channel::at;
///
/// // Converts a number of milliseconds into a `Duration`.
/// let ms = |ms| Duration::from_millis(ms);
///
/// let start = Instant::now();
/// let end = start + ms(100);
///
/// let r = at(end);
///
/// // This message was sent 100 ms from the start
/// assert_eq!(r.recv().unwrap(), end);
/// assert!(Instant::now() > start + ms(100));
/// ```
pub fn at(when: Instant) -> Receiver<Instant> {
    Receiver {
        flavor: ReceiverFlavor::At(Arc::new(flavors::at::Channel::new_deadline(when))),
    }
}

/// Creates a receiver that never delivers messages.
///
/// The channel is bounded with capacity of 0 and never gets disconnected.
///
/// # Examples
///
/// Using a `never` channel to optionally add a timeout to [`select!`]:
///
/// [`select!`]: crate::select!
///
/// ```
/// use std::thread;
/// use std::time::Duration;
/// use crossbeam_channel::{after, select, never, unbounded};
///
/// let (s, r) = unbounded();
///
/// # let t =
/// thread::spawn(move || {
///     thread::sleep(Duration::from_secs(1));
///     s.send(1).unwrap();
/// });
///
/// // Suppose this duration can be a `Some` or a `None`.
/// let duration = Some(Duration::from_millis(100));
///
/// // Create a channel that times out after the specified duration.
/// let timeout = duration
///     .map(after)
///     .unwrap_or_else(never);
///
/// select! {
///     recv(r) -> msg => assert_eq!(msg, Ok(1)),
///     recv(timeout) -> _ => println!("timed out"),
/// }
/// # t.join().unwrap(); // join thread to avoid https://github.com/rust-lang/miri/issues/1371
/// ```
pub fn never<T>() -> Receiver<T> {
    Receiver {
        flavor: ReceiverFlavor::Never(flavors::never::Channel::new()),
    }
}

/// Creates a receiver that delivers messages periodically.
///
/// The channel is bounded with capacity of 1 and never gets disconnected. Messages will be
/// sent into the channel in intervals of `duration`. Each message is the instant at which it is
/// sent.
///
/// # Examples
///
/// Using a `tick` channel to periodically print elapsed time:
///
/// ```
/// use std::time::{Duration, Instant};
/// use crossbeam_channel::tick;
///
/// let start = Instant::now();
/// let ticker = tick(Duration::from_millis(100));
///
/// for _ in 0..5 {
///     ticker.recv().unwrap();
///     println!("elapsed: {:?}", start.elapsed());
/// }
/// ```
///
/// When messages get sent:
///
/// ```
/// # if cfg!(gha_macos_runner) { return; } // GitHub-hosted macOS runner is slow
/// use std::thread;
/// use std::time::{Duration, Instant};
/// use crossbeam_channel::tick;
///
/// // Converts a number of milliseconds into a `Duration`.
/// let ms = |ms| Duration::from_millis(ms);
///
/// // Returns `true` if `a` and `b` are very close `Instant`s.
/// let eq = |a, b| a + ms(65) > b && b + ms(65) > a;
///
/// let start = Instant::now();
/// let r = tick(ms(100));
///
/// // This message was sent 100 ms from the start and received 100 ms from the start.
/// assert!(eq(r.recv().unwrap(), start + ms(100)));
/// assert!(eq(Instant::now(), start + ms(100)));
///
/// thread::sleep(ms(500));
///
/// // This message was sent 200 ms from the start and received 600 ms from the start.
/// assert!(eq(r.recv().unwrap(), start + ms(200)));
/// assert!(eq(Instant::now(), start + ms(600)));
///
/// // This message was sent 700 ms from the start and received 700 ms from the start.
/// assert!(eq(r.recv().unwrap(), start + ms(700)));
/// assert!(eq(Instant::now(), start + ms(700)));
/// ```
pub fn tick(duration: Duration) -> Receiver<Instant> {
    match Instant::now().checked_add(duration) {
        Some(delivery_time) => Receiver {
            flavor: ReceiverFlavor::Tick(Arc::new(flavors::tick::Channel::new(
                delivery_time,
                duration,
            ))),
        },
        None => never(),
    }
}

/// The sending side of a channel.
///
/// # Examples
///
/// ```
/// use std::thread;
/// use crossbeam_channel::unbounded;
///
/// let (s1, r) = unbounded();
/// let s2 = s1.clone();
///
/// thread::spawn(move || s1.send(1).unwrap());
/// thread::spawn(move || s2.send(2).unwrap());
///
/// let msg1 = r.recv().unwrap();
/// let msg2 = r.recv().unwrap();
///
/// assert_eq!(msg1 + msg2, 3);
/// ```
pub struct Sender<T> {
    flavor: SenderFlavor<T>,
}

/// Sender flavors.
enum SenderFlavor<T> {
    /// Bounded channel based on a preallocated array.
    Array(counter::Sender<flavors::array::Channel<T>>),

    /// Unbounded channel implemented as a linked list.
    List(counter::Sender<flavors::list::Channel<T>>),

    /// Zero-capacity channel.
    Zero(counter::Sender<flavors::zero::Channel<T>>),
}

unsafe impl<T: Send> Send for Sender<T> {}
unsafe impl<T: Send> Sync for Sender<T> {}

impl<T> UnwindSafe for Sender<T> {}
impl<T> RefUnwindSafe for Sender<T> {}

impl<T> Sender<T> {
    /// Attempts to send a message into the channel without blocking.
    ///
    /// This method will either send a message into the channel immediately or return an error if
    /// the channel is full or disconnected. The returned error contains the original message.
    ///
    /// If called on a zero-capacity channel, this method will send the message only if there
    /// happens to be a receive operation on the other side of the channel at the same time.
    ///
    /// # Examples
    ///
    /// ```
    /// use crossbeam_channel::{bounded, TrySendError};
    ///
    /// let (s, r) = bounded(1);
    ///
    /// assert_eq!(s.try_send(1), Ok(()));
    /// assert_eq!(s.try_send(2), Err(TrySendError::Full(2)));
    ///
    /// drop(r);
    /// assert_eq!(s.try_send(3), Err(TrySendError::Disconnected(3)));
    /// ```
    pub fn try_send(&self, msg: T) -> Result<(), TrySendError<T>> {
        match &self.flavor {
            SenderFlavor::Array(chan) => chan.try_send(msg),
            SenderFlavor::List(chan) => chan.try_send(msg),
            SenderFlavor::Zero(chan) => chan.try_send(msg),
        }
    }

    /// Blocks the current thread until a message is sent or the channel is disconnected.
    ///
    /// If the channel is full and not disconnected, this call will block until the send operation
    /// can proceed. If the channel becomes disconnected, this call will wake up and return an
    /// error. The returned error contains the original message.
    ///
    /// If called on a zero-capacity channel, this method will wait for a receive operation to
    /// appear on the other side of the channel.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::thread;
    /// use std::time::Duration;
    /// use crossbeam_channel::{bounded, SendError};
    ///
    /// let (s, r) = bounded(1);
    /// assert_eq!(s.send(1), Ok(()));
    ///
    /// thread::spawn(move || {
    ///     assert_eq!(r.recv(), Ok(1));
    ///     thread::sleep(Duration::from_secs(1));
    ///     drop(r);
    /// });
    ///
    /// assert_eq!(s.send(2), Ok(()));
    /// assert_eq!(s.send(3), Err(SendError(3)));
    /// ```
    pub fn send(&self, msg: T) -> Result<(), SendError<T>> {
        match &self.flavor {
            SenderFlavor::Array(chan) => chan.send(msg, None),
            SenderFlavor::List(chan) => chan.send(msg, None),
            SenderFlavor::Zero(chan) => chan.send(msg, None),
        }
        .map_err(|err| match err {
            SendTimeoutError::Disconnected(msg) => SendError(msg),
            SendTimeoutError::Timeout(_) => unreachable!(),
        })
    }

    /// Waits for a message to be sent into the channel, but only for a limited time.
    ///
    /// If the channel is full and not disconnected, this call will block until the send operation
    /// can proceed or the operation times out. If the channel becomes disconnected, this call will
    /// wake up and return an error. The returned error contains the original message.
    ///
    /// If called on a zero-capacity channel, this method will wait for a receive operation to
    /// appear on the other side of the channel.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::thread;
    /// use std::time::Duration;
    /// use crossbeam_channel::{bounded, SendTimeoutError};
    ///
    /// let (s, r) = bounded(0);
    ///
    /// thread::spawn(move || {
    ///     thread::sleep(Duration::from_secs(1));
    ///     assert_eq!(r.recv(), Ok(2));
    ///     drop(r);
    /// });
    ///
    /// assert_eq!(
    ///     s.send_timeout(1, Duration::from_millis(500)),
    ///     Err(SendTimeoutError::Timeout(1)),
    /// );
    /// assert_eq!(
    ///     s.send_timeout(2, Duration::from_secs(1)),
    ///     Ok(()),
    /// );
    /// assert_eq!(
    ///     s.send_timeout(3, Duration::from_millis(500)),
    ///     Err(SendTimeoutError::Disconnected(3)),
    /// );
    /// ```
    pub fn send_timeout(&self, msg: T, timeout: Duration) -> Result<(), SendTimeoutError<T>> {
        match Instant::now().checked_add(timeout) {
            Some(deadline) => self.send_deadline(msg, deadline),
            None => self.send(msg).map_err(SendTimeoutError::from),
        }
    }

    /// Waits for a message to be sent into the channel, but only until a given deadline.
    ///
    /// If the channel is full and not disconnected, this call will block until the send operation
    /// can proceed or the operation times out. If the channel becomes disconnected, this call will
    /// wake up and return an error. The returned error contains the original message.
    ///
    /// If called on a zero-capacity channel, this method will wait for a receive operation to
    /// appear on the other side of the channel.
    ///
    /// # Examples
    ///
    /// ```
    /// use std::thread;
    /// use std::time::{Duration, Instant};
    /// use crossbeam_channel::{bounded, SendTimeoutError};
    ///
    /// let (s, r) = bounded(0);
    ///
    /// thread::spawn(move || {
    ///     thread::sleep(Duration::from_secs(1));
    ///     assert_eq!(r.recv(), Ok(2));
    ///     drop(r);
    /// });
    ///
    /// let now = Instant::now();
    ///
    /// assert_eq!(
    ///     s.send_deadline(1, now + Duration::from_millis(500)),
    ///     Err(SendTimeoutError::Timeout(1)),
    /// );
    /// assert_eq!(
    ///     s.send_deadline(2, now + Duration::from_millis(1500)),
    ///     Ok(()),
    /// );
    /// assert_eq!(
    ///     s.send_deadline(3, now + Duration::from_millis(2000)),
    ///     Err(SendTimeoutError::Disconnected(3)),
    /// );
    /// ```
    pub fn send_deadline(&self, msg: T, deadline: Instant) -> Result<(), SendTimeoutError<T>> {
        match &self.flavor {
            SenderFlavor::Array(chan) => chan.send(msg, Some(deadline)),
            SenderFlavor::List(chan) => chan.send(msg, Some(deadline)),
            SenderFlavor::Zero(chan) => chan.send(msg, Some(deadline)),
        }
    }

    /// Returns `true` if the channel is empty.
    ///
    /// Note: Zero-capacity channels are always empty.
    ///
    /// # Examples
    ///
    /// ```
    /// use crossbeam_channel::unbounded;
    ///
    /// let (s, r) = unbounded();
    /// assert!(s.is_empty());
    ///
    /// s.send(0).unwrap();
    /// assert!(!s.is_empty());
    /// ```
    pub fn is_empty(&self) -> bool {
        match &self.flavor {
            SenderFlavor::Array(chan) => chan.is_empty(),
            SenderFlavor::List(chan) => chan.is_empty(),
            SenderFlavor::Zero(cha
Download .txt
gitextract_qjwqdnoi/

├── .clippy.toml
├── .editorconfig
├── .github/
│   ├── dependabot.yml
│   └── workflows/
│       ├── ci.yml
│       └── release.yml
├── .gitignore
├── .rustfmt.toml
├── .shellcheckrc
├── .taplo.toml
├── CHANGELOG.md
├── Cargo.toml
├── LICENSE-APACHE
├── LICENSE-MIT
├── README.md
├── build-common.rs
├── ci/
│   ├── careful.sh
│   ├── check-features.sh
│   ├── crossbeam-epoch-loom.sh
│   ├── dependencies.sh
│   ├── miri.sh
│   ├── no_atomic.sh
│   ├── san.sh
│   ├── test.sh
│   └── tsan
├── crossbeam-channel/
│   ├── CHANGELOG.md
│   ├── Cargo.toml
│   ├── LICENSE-APACHE
│   ├── LICENSE-MIT
│   ├── LICENSE-THIRD-PARTY
│   ├── README.md
│   ├── benches/
│   │   └── crossbeam.rs
│   ├── benchmarks/
│   │   ├── Cargo.toml
│   │   ├── README.md
│   │   ├── atomicring.rs
│   │   ├── atomicringqueue.rs
│   │   ├── bus.rs
│   │   ├── crossbeam-channel.rs
│   │   ├── crossbeam-deque.rs
│   │   ├── flume.rs
│   │   ├── futures-channel.rs
│   │   ├── go.go
│   │   ├── lockfree.rs
│   │   ├── message.rs
│   │   ├── mpmc.rs
│   │   ├── mpsc.rs
│   │   ├── plot.py
│   │   ├── run.sh
│   │   └── segqueue.rs
│   ├── examples/
│   │   ├── fibonacci.rs
│   │   ├── matching.rs
│   │   └── stopwatch.rs
│   ├── src/
│   │   ├── channel.rs
│   │   ├── context.rs
│   │   ├── counter.rs
│   │   ├── err.rs
│   │   ├── flavors/
│   │   │   ├── array.rs
│   │   │   ├── at.rs
│   │   │   ├── list.rs
│   │   │   ├── mod.rs
│   │   │   ├── never.rs
│   │   │   ├── tick.rs
│   │   │   └── zero.rs
│   │   ├── lib.rs
│   │   ├── select.rs
│   │   ├── select_macro.rs
│   │   ├── utils.rs
│   │   └── waker.rs
│   └── tests/
│       ├── after.rs
│       ├── array.rs
│       ├── golang.rs
│       ├── iter.rs
│       ├── list.rs
│       ├── mpsc.rs
│       ├── never.rs
│       ├── ready.rs
│       ├── same_channel.rs
│       ├── select.rs
│       ├── select_macro.rs
│       ├── thread_locals.rs
│       ├── tick.rs
│       └── zero.rs
├── crossbeam-deque/
│   ├── CHANGELOG.md
│   ├── Cargo.toml
│   ├── LICENSE-APACHE
│   ├── LICENSE-MIT
│   ├── README.md
│   ├── build.rs
│   ├── src/
│   │   ├── deque.rs
│   │   └── lib.rs
│   └── tests/
│       ├── fifo.rs
│       ├── injector.rs
│       ├── lifo.rs
│       └── steal.rs
├── crossbeam-epoch/
│   ├── CHANGELOG.md
│   ├── Cargo.toml
│   ├── LICENSE-APACHE
│   ├── LICENSE-MIT
│   ├── README.md
│   ├── benches/
│   │   ├── defer.rs
│   │   ├── flush.rs
│   │   └── pin.rs
│   ├── build.rs
│   ├── examples/
│   │   └── sanitize.rs
│   ├── src/
│   │   ├── atomic.rs
│   │   ├── collector.rs
│   │   ├── default.rs
│   │   ├── deferred.rs
│   │   ├── epoch.rs
│   │   ├── guard.rs
│   │   ├── internal.rs
│   │   ├── lib.rs
│   │   └── sync/
│   │       ├── list.rs
│   │       ├── mod.rs
│   │       └── queue.rs
│   └── tests/
│       └── loom.rs
├── crossbeam-queue/
│   ├── CHANGELOG.md
│   ├── Cargo.toml
│   ├── LICENSE-APACHE
│   ├── LICENSE-MIT
│   ├── README.md
│   ├── src/
│   │   ├── array_queue.rs
│   │   ├── lib.rs
│   │   └── seg_queue.rs
│   └── tests/
│       ├── array_queue.rs
│       └── seg_queue.rs
├── crossbeam-skiplist/
│   ├── CHANGELOG.md
│   ├── Cargo.toml
│   ├── LICENSE-APACHE
│   ├── LICENSE-MIT
│   ├── README.md
│   ├── benches/
│   │   ├── btree.rs
│   │   ├── hash.rs
│   │   ├── skiplist.rs
│   │   └── skipmap.rs
│   ├── examples/
│   │   └── simple.rs
│   ├── src/
│   │   ├── base.rs
│   │   ├── comparator.rs
│   │   ├── equivalent.rs
│   │   ├── lib.rs
│   │   ├── map.rs
│   │   └── set.rs
│   └── tests/
│       ├── base.rs
│       ├── map.rs
│       └── set.rs
├── crossbeam-utils/
│   ├── CHANGELOG.md
│   ├── Cargo.toml
│   ├── LICENSE-APACHE
│   ├── LICENSE-MIT
│   ├── README.md
│   ├── benches/
│   │   └── atomic_cell.rs
│   ├── build.rs
│   ├── src/
│   │   ├── alloc_helper.rs
│   │   ├── atomic/
│   │   │   ├── atomic_cell.rs
│   │   │   ├── consume.rs
│   │   │   ├── mod.rs
│   │   │   ├── seq_lock.rs
│   │   │   └── seq_lock_wide.rs
│   │   ├── backoff.rs
│   │   ├── cache_padded.rs
│   │   ├── lib.rs
│   │   ├── sync/
│   │   │   ├── mod.rs
│   │   │   ├── once_lock.rs
│   │   │   ├── parker.rs
│   │   │   ├── sharded_lock.rs
│   │   │   └── wait_group.rs
│   │   └── thread.rs
│   └── tests/
│       ├── atomic_cell.rs
│       ├── cache_padded.rs
│       ├── parker.rs
│       ├── sharded_lock.rs
│       ├── thread.rs
│       └── wait_group.rs
├── no_atomic.rs
├── src/
│   └── lib.rs
├── tests/
│   └── subcrates.rs
└── tools/
    └── publish.sh
Download .txt
SYMBOL INDEX (2166 symbols across 107 files)

FILE: build-common.rs
  function convert_custom_linux_target (line 6) | fn convert_custom_linux_target(target: String) -> String {

FILE: crossbeam-channel/benches/crossbeam.rs
  constant TOTAL_STEPS (line 11) | const TOTAL_STEPS: usize = 40_000;
  function num_cpus (line 13) | fn num_cpus() -> usize {
  function create (line 23) | fn create(b: &mut Bencher) {
  function oneshot (line 28) | fn oneshot(b: &mut Bencher) {
  function inout (line 37) | fn inout(b: &mut Bencher) {
  function par_inout (line 46) | fn par_inout(b: &mut Bencher) {
  function spsc (line 80) | fn spsc(b: &mut Bencher) {
  function spmc (line 109) | fn spmc(b: &mut Bencher) {
  function mpsc (line 145) | fn mpsc(b: &mut Bencher) {
  function mpmc (line 181) | fn mpmc(b: &mut Bencher) {
  function spsc (line 228) | fn spsc(b: &mut Bencher) {
  function spmc (line 257) | fn spmc(b: &mut Bencher) {
  function mpsc (line 293) | fn mpsc(b: &mut Bencher) {
  function par_inout (line 329) | fn par_inout(b: &mut Bencher) {
  function mpmc (line 363) | fn mpmc(b: &mut Bencher) {
  function create (line 411) | fn create(b: &mut Bencher) {
  function oneshot (line 416) | fn oneshot(b: &mut Bencher) {
  function spsc (line 425) | fn spsc(b: &mut Bencher) {
  function spmc (line 454) | fn spmc(b: &mut Bencher) {
  function mpsc (line 490) | fn mpsc(b: &mut Bencher) {
  function mpmc (line 526) | fn mpmc(b: &mut Bencher) {
  function create (line 573) | fn create(b: &mut Bencher) {
  function spsc (line 578) | fn spsc(b: &mut Bencher) {
  function spmc (line 607) | fn spmc(b: &mut Bencher) {
  function mpsc (line 643) | fn mpsc(b: &mut Bencher) {
  function mpmc (line 679) | fn mpmc(b: &mut Bencher) {

FILE: crossbeam-channel/benchmarks/atomicring.rs
  constant MESSAGES (line 7) | const MESSAGES: usize = 5_000_000;
  constant THREADS (line 8) | const THREADS: usize = 4;
  function seq (line 10) | fn seq(cap: usize) {
  function spsc (line 28) | fn spsc(cap: usize) {
  function mpsc (line 57) | fn mpsc(cap: usize) {
  function mpmc (line 88) | fn mpmc(cap: usize) {
  function main (line 122) | fn main() {

FILE: crossbeam-channel/benchmarks/atomicringqueue.rs
  constant MESSAGES (line 7) | const MESSAGES: usize = 5_000_000;
  constant THREADS (line 8) | const THREADS: usize = 4;
  function seq (line 10) | fn seq(cap: usize) {
  function spsc (line 28) | fn spsc(cap: usize) {
  function mpsc (line 51) | fn mpsc(cap: usize) {
  function mpmc (line 76) | fn mpmc(cap: usize) {
  function main (line 105) | fn main() {

FILE: crossbeam-channel/benchmarks/bus.rs
  constant MESSAGES (line 5) | const MESSAGES: usize = 5_000_000;
  function seq (line 7) | fn seq(cap: usize) {
  function spsc (line 20) | fn spsc(cap: usize) {
  function main (line 38) | fn main() {

FILE: crossbeam-channel/benchmarks/crossbeam-channel.rs
  constant MESSAGES (line 5) | const MESSAGES: usize = 5_000_000;
  constant THREADS (line 6) | const THREADS: usize = 4;
  function new (line 8) | fn new<T>(cap: Option<usize>) -> (Sender<T>, Receiver<T>) {
  function seq (line 15) | fn seq(cap: Option<usize>) {
  function spsc (line 27) | fn spsc(cap: Option<usize>) {
  function mpsc (line 44) | fn mpsc(cap: Option<usize>) {
  function mpmc (line 63) | fn mpmc(cap: Option<usize>) {
  function select_rx (line 86) | fn select_rx(cap: Option<usize>) {
  function select_both (line 112) | fn select_both(cap: Option<usize>) {
  function main (line 147) | fn main() {

FILE: crossbeam-channel/benchmarks/crossbeam-deque.rs
  constant MESSAGES (line 7) | const MESSAGES: usize = 5_000_000;
  function seq (line 9) | fn seq() {
  function spsc (line 26) | fn spsc() {
  function main (line 51) | fn main() {

FILE: crossbeam-channel/benchmarks/flume.rs
  constant MESSAGES (line 3) | const MESSAGES: usize = 5_000_000;
  constant THREADS (line 4) | const THREADS: usize = 4;
  function shuffle (line 6) | pub fn shuffle<T>(v: &mut [T]) {
  function seq_unbounded (line 40) | fn seq_unbounded() {
  function seq_bounded (line 52) | fn seq_bounded(cap: usize) {
  function spsc_unbounded (line 64) | fn spsc_unbounded() {
  function spsc_bounded (line 81) | fn spsc_bounded(cap: usize) {
  function mpsc_unbounded (line 98) | fn mpsc_unbounded() {
  function mpsc_bounded (line 118) | fn mpsc_bounded(cap: usize) {
  function main (line 138) | fn main() {

FILE: crossbeam-channel/benchmarks/futures-channel.rs
  constant MESSAGES (line 10) | const MESSAGES: usize = 5_000_000;
  constant THREADS (line 11) | const THREADS: usize = 4;
  function seq_unbounded (line 13) | fn seq_unbounded() {
  function seq_bounded (line 25) | fn seq_bounded(cap: usize) {
  function spsc_unbounded (line 37) | fn spsc_unbounded() {
  function spsc_bounded (line 52) | fn spsc_bounded(cap: usize) {
  function mpsc_unbounded (line 67) | fn mpsc_unbounded() {
  function mpsc_bounded (line 88) | fn mpsc_bounded(cap: usize) {
  function select_rx_unbounded (line 109) | fn select_rx_unbounded() {
  function select_rx_bounded (line 129) | fn select_rx_bounded(cap: usize) {
  function main (line 151) | fn main() {

FILE: crossbeam-channel/benchmarks/go.go
  constant MESSAGES (line 6) | MESSAGES = 5 * 1000 * 1000
  constant THREADS (line 7) | THREADS = 4
  function seq (line 11) | func seq(cap int) {
  function spsc (line 23) | func spsc(cap int) {
  function mpsc (line 41) | func mpsc(cap int) {
  function mpmc (line 63) | func mpmc(cap int) {
  function select_rx (line 92) | func select_rx(cap int) {
  function select_both (line 128) | func select_both(cap int) {
  function run (line 175) | func run(name string, f func(int), cap int) {
  function main (line 182) | func main() {

FILE: crossbeam-channel/benchmarks/lockfree.rs
  constant MESSAGES (line 5) | const MESSAGES: usize = 5_000_000;
  constant THREADS (line 6) | const THREADS: usize = 4;
  function seq (line 10) | fn seq() {
  function spsc (line 24) | fn spsc() {
  function mpsc (line 43) | fn mpsc() {
  function mpmc (line 64) | fn mpmc() {
  function main (line 89) | fn main() {

FILE: crossbeam-channel/benchmarks/message.rs
  constant LEN (line 3) | const LEN: usize = 1;
  type Message (line 6) | pub(crate) struct Message(#[allow(dead_code)] [usize; LEN]);
    method fmt (line 9) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  function new (line 15) | pub(crate) fn new(num: usize) -> Message {

FILE: crossbeam-channel/benchmarks/mpmc.rs
  constant MESSAGES (line 5) | const MESSAGES: usize = 5_000_000;
  constant THREADS (line 6) | const THREADS: usize = 4;
  function seq (line 8) | fn seq(cap: usize) {
  function spsc (line 26) | fn spsc(cap: usize) {
  function mpsc (line 55) | fn mpsc(cap: usize) {
  function mpmc (line 86) | fn mpmc(cap: usize) {
  function main (line 121) | fn main() {

FILE: crossbeam-channel/benchmarks/mpsc.rs
  constant MESSAGES (line 5) | const MESSAGES: usize = 5_000_000;
  constant THREADS (line 6) | const THREADS: usize = 4;
  function shuffle (line 8) | pub fn shuffle<T>(v: &mut [T]) {
  function seq_async (line 42) | fn seq_async() {
  function seq_sync (line 54) | fn seq_sync(cap: usize) {
  function spsc_async (line 66) | fn spsc_async() {
  function spsc_sync (line 83) | fn spsc_sync(cap: usize) {
  function mpsc_async (line 100) | fn mpsc_async() {
  function mpsc_sync (line 120) | fn mpsc_sync(cap: usize) {
  function main (line 140) | fn main() {

FILE: crossbeam-channel/benchmarks/plot.py
  function read_data (line 7) | def read_data(files):
  function get_runs (line 18) | def get_runs(results, prefix):
  function find (line 28) | def find(s, x):
  function get_color (line 79) | def get_color(name):
  function plot (line 86) | def plot(results, fig, subplot, title, prefix):
  function plot_all (line 117) | def plot_all(results, descriptions, labels):
  function main (line 135) | def main():

FILE: crossbeam-channel/benchmarks/segqueue.rs
  constant MESSAGES (line 7) | const MESSAGES: usize = 5_000_000;
  constant THREADS (line 8) | const THREADS: usize = 4;
  function seq (line 10) | fn seq() {
  function spsc (line 22) | fn spsc() {
  function mpsc (line 45) | fn mpsc() {
  function mpmc (line 70) | fn mpmc() {
  function main (line 99) | fn main() {

FILE: crossbeam-channel/examples/fibonacci.rs
  function fibonacci (line 8) | fn fibonacci(sender: Sender<u64>) {
  function main (line 17) | fn main() {

FILE: crossbeam-channel/examples/matching.rs
  function main (line 48) | fn main() {

FILE: crossbeam-channel/examples/stopwatch.rs
  function main (line 4) | fn main() {
  function main (line 9) | fn main() {

FILE: crossbeam-channel/src/channel.rs
  function unbounded (line 50) | pub fn unbounded<T>() -> (Sender<T>, Receiver<T>) {
  function bounded (line 113) | pub fn bounded<T>(cap: usize) -> (Sender<T>, Receiver<T>) {
  function after (line 181) | pub fn after(duration: Duration) -> Receiver<Instant> {
  function at (line 232) | pub fn at(when: Instant) -> Receiver<Instant> {
  function never (line 275) | pub fn never<T>() -> Receiver<T> {
  function tick (line 335) | pub fn tick(duration: Duration) -> Receiver<Instant> {
  type Sender (line 366) | pub struct Sender<T> {
  type SenderFlavor (line 371) | enum SenderFlavor<T> {
  function try_send (line 410) | pub fn try_send(&self, msg: T) -> Result<(), TrySendError<T>> {
  function send (line 446) | pub fn send(&self, msg: T) -> Result<(), SendError<T>> {
  function send_timeout (line 495) | pub fn send_timeout(&self, msg: T, timeout: Duration) -> Result<(), Send...
  function send_deadline (line 541) | pub fn send_deadline(&self, msg: T, deadline: Instant) -> Result<(), Sen...
  function is_empty (line 564) | pub fn is_empty(&self) -> bool {
  function is_full (line 587) | pub fn is_full(&self) -> bool {
  function len (line 609) | pub fn len(&self) -> usize {
  function capacity (line 633) | pub fn capacity(&self) -> Option<usize> {
  function same_channel (line 656) | pub fn same_channel(&self, other: &Self) -> bool {
  function addr (line 665) | pub(crate) fn addr(&self) -> usize {
  method drop (line 675) | fn drop(&mut self) {
  method clone (line 687) | fn clone(&self) -> Self {
  function fmt (line 699) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  type Receiver (line 724) | pub struct Receiver<T> {
  type ReceiverFlavor (line 729) | enum ReceiverFlavor<T> {
  function try_recv (line 778) | pub fn try_recv(&self) -> Result<T, TryRecvError> {
  function recv (line 831) | pub fn recv(&self) -> Result<T, RecvError> {
  function recv_timeout (line 896) | pub fn recv_timeout(&self, timeout: Duration) -> Result<T, RecvTimeoutEr...
  function recv_deadline (line 942) | pub fn recv_deadline(&self, deadline: Instant) -> Result<T, RecvTimeoutE...
  function is_empty (line 984) | pub fn is_empty(&self) -> bool {
  function is_full (line 1010) | pub fn is_full(&self) -> bool {
  function len (line 1035) | pub fn len(&self) -> usize {
  function capacity (line 1062) | pub fn capacity(&self) -> Option<usize> {
  function iter (line 1101) | pub fn iter(&self) -> Iter<'_, T> {
  function try_iter (line 1139) | pub fn try_iter(&self) -> TryIter<'_, T> {
  function same_channel (line 1158) | pub fn same_channel(&self, other: &Self) -> bool {
  function addr (line 1170) | pub(crate) fn addr(&self) -> usize {
  method drop (line 1183) | fn drop(&mut self) {
  method clone (line 1198) | fn clone(&self) -> Self {
  function fmt (line 1213) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  type Item (line 1219) | type Item = T;
  type IntoIter (line 1220) | type IntoIter = Iter<'a, T>;
  method into_iter (line 1222) | fn into_iter(self) -> Self::IntoIter {
  type Item (line 1228) | type Item = T;
  type IntoIter (line 1229) | type IntoIter = IntoIter<T>;
  method into_iter (line 1231) | fn into_iter(self) -> Self::IntoIter {
  type Iter (line 1264) | pub struct Iter<'a, T> {
  type Item (line 1271) | type Item = T;
  method next (line 1273) | fn next(&mut self) -> Option<Self::Item> {
  function fmt (line 1279) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  type TryIter (line 1318) | pub struct TryIter<'a, T> {
  type Item (line 1323) | type Item = T;
  method next (line 1325) | fn next(&mut self) -> Option<Self::Item> {
  function fmt (line 1331) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  type IntoIter (line 1364) | pub struct IntoIter<T> {
  type Item (line 1371) | type Item = T;
  method next (line 1373) | fn next(&mut self) -> Option<Self::Item> {
  function fmt (line 1379) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  method try_select (line 1385) | fn try_select(&self, token: &mut Token) -> bool {
  method deadline (line 1393) | fn deadline(&self) -> Option<Instant> {
  method register (line 1397) | fn register(&self, oper: Operation, cx: &Context) -> bool {
  method unregister (line 1405) | fn unregister(&self, oper: Operation) {
  method accept (line 1413) | fn accept(&self, token: &mut Token, cx: &Context) -> bool {
  method is_ready (line 1421) | fn is_ready(&self) -> bool {
  method watch (line 1429) | fn watch(&self, oper: Operation, cx: &Context) -> bool {
  method unwatch (line 1437) | fn unwatch(&self, oper: Operation) {
  method try_select (line 1447) | fn try_select(&self, token: &mut Token) -> bool {
  method deadline (line 1458) | fn deadline(&self) -> Option<Instant> {
  method register (line 1469) | fn register(&self, oper: Operation, cx: &Context) -> bool {
  method unregister (line 1480) | fn unregister(&self, oper: Operation) {
  method accept (line 1491) | fn accept(&self, token: &mut Token, cx: &Context) -> bool {
  method is_ready (line 1502) | fn is_ready(&self) -> bool {
  method watch (line 1513) | fn watch(&self, oper: Operation, cx: &Context) -> bool {
  method unwatch (line 1524) | fn unwatch(&self, oper: Operation) {
  function write (line 1537) | pub(crate) unsafe fn write<T>(s: &Sender<T>, token: &mut Token, msg: T) ...
  function read (line 1548) | pub(crate) unsafe fn read<T>(r: &Receiver<T>, token: &mut Token) -> Resu...

FILE: crossbeam-channel/src/context.rs
  type Context (line 21) | pub struct Context {
    method with (line 44) | pub fn with<F, R>(f: F) -> R
    method new (line 74) | fn new() -> Self {
    method reset (line 87) | fn reset(&self) {
    method try_select (line 98) | pub fn try_select(&self, select: Selected) -> Result<(), Selected> {
    method selected (line 113) | pub fn selected(&self) -> Selected {
    method store_packet (line 121) | pub fn store_packet(&self, packet: *mut ()) {
    method wait_packet (line 129) | pub fn wait_packet(&self) -> *mut () {
    method wait_until (line 144) | pub fn wait_until(&self, deadline: Option<Instant>) -> Selected {
    method unpark (line 173) | pub fn unpark(&self) {
    method thread_id (line 179) | pub fn thread_id(&self) -> ThreadId {
  type Inner (line 27) | struct Inner {

FILE: crossbeam-channel/src/counter.rs
  type Counter (line 12) | struct Counter<C> {
  function new (line 27) | pub(crate) fn new<C>(chan: C) -> (Sender<C>, Receiver<C>) {
  type Sender (line 40) | pub(crate) struct Sender<C> {
  function counter (line 46) | fn counter(&self) -> &Counter<C> {
  function acquire (line 51) | pub(crate) fn acquire(&self) -> Self {
  function release (line 69) | pub(crate) unsafe fn release<F: FnOnce(&C) -> bool>(&self, disconnect: F) {
  function addr (line 79) | pub(crate) fn addr(&self) -> usize {
  type Target (line 85) | type Target = C;
  function deref (line 87) | fn deref(&self) -> &C {
  method eq (line 93) | fn eq(&self, other: &Self) -> bool {
  type Receiver (line 99) | pub(crate) struct Receiver<C> {
  function counter (line 105) | fn counter(&self) -> &Counter<C> {
  function acquire (line 110) | pub(crate) fn acquire(&self) -> Self {
  function release (line 128) | pub(crate) unsafe fn release<F: FnOnce(&C) -> bool>(&self, disconnect: F) {
  function addr (line 138) | pub(crate) fn addr(&self) -> usize {
  type Target (line 144) | type Target = C;
  function deref (line 146) | fn deref(&self) -> &C {
  method eq (line 152) | fn eq(&self, other: &Self) -> bool {

FILE: crossbeam-channel/src/err.rs
  type SendError (line 12) | pub struct SendError<T>(pub T);
  type TrySendError (line 20) | pub enum TrySendError<T> {
  type SendTimeoutError (line 37) | pub enum SendTimeoutError<T> {
  type RecvError (line 54) | pub struct RecvError;
    method fmt (line 271) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  type TryRecvError (line 60) | pub enum TryRecvError {
    method fmt (line 279) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
    method from (line 290) | fn from(err: RecvError) -> Self {
    method is_empty (line 299) | pub fn is_empty(&self) -> bool {
    method is_disconnected (line 304) | pub fn is_disconnected(&self) -> bool {
  type RecvTimeoutError (line 75) | pub enum RecvTimeoutError {
    method fmt (line 310) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
    method from (line 321) | fn from(err: RecvError) -> Self {
    method is_timeout (line 330) | pub fn is_timeout(&self) -> bool {
    method is_disconnected (line 335) | pub fn is_disconnected(&self) -> bool {
  type TrySelectError (line 92) | pub struct TrySelectError;
    method fmt (line 341) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  type SelectTimeoutError (line 100) | pub struct SelectTimeoutError;
    method fmt (line 349) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  type TryReadyError (line 108) | pub struct TryReadyError;
  type ReadyTimeoutError (line 116) | pub struct ReadyTimeoutError;
  function fmt (line 119) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  function fmt (line 125) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  function into_inner (line 147) | pub fn into_inner(self) -> T {
  function fmt (line 153) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  function fmt (line 162) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  function from (line 173) | fn from(err: SendError<T>) -> Self {
  function into_inner (line 194) | pub fn into_inner(self) -> T {
  function is_full (line 202) | pub fn is_full(&self) -> bool {
  function is_disconnected (line 207) | pub fn is_disconnected(&self) -> bool {
  function fmt (line 213) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  function fmt (line 219) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  function from (line 230) | fn from(err: SendError<T>) -> Self {
  function into_inner (line 252) | pub fn into_inner(self) -> T {
  function is_timeout (line 260) | pub fn is_timeout(&self) -> bool {
  function is_disconnected (line 265) | pub fn is_disconnected(&self) -> bool {

FILE: crossbeam-channel/src/flavors/array.rs
  type Slot (line 30) | struct Slot<T> {
  type ArrayToken (line 40) | pub(crate) struct ArrayToken {
  method default (line 50) | fn default() -> Self {
  type Channel (line 59) | pub(crate) struct Channel<T> {
  function with_capacity (line 96) | pub(crate) fn with_capacity(cap: usize) -> Self {
  function receiver (line 132) | pub(crate) fn receiver(&self) -> Receiver<'_, T> {
  function sender (line 137) | pub(crate) fn sender(&self) -> Sender<'_, T> {
  function start_send (line 142) | fn start_send(&self, token: &mut Token) -> bool {
  function write (line 214) | pub(crate) unsafe fn write(&self, token: &mut Token, msg: T) -> Result<(...
  function start_recv (line 232) | fn start_recv(&self, token: &mut Token) -> bool {
  function read (line 305) | pub(crate) unsafe fn read(&self, token: &mut Token) -> Result<T, ()> {
  function try_send (line 323) | pub(crate) fn try_send(&self, msg: T) -> Result<(), TrySendError<T>> {
  function send (line 333) | pub(crate) fn send(
  function try_recv (line 386) | pub(crate) fn try_recv(&self) -> Result<T, TryRecvError> {
  function recv (line 397) | pub(crate) fn recv(&self, deadline: Option<Instant>) -> Result<T, RecvTi...
  function len (line 448) | pub(crate) fn len(&self) -> usize {
  function cap (line 474) | fn cap(&self) -> usize {
  function capacity (line 479) | pub(crate) fn capacity(&self) -> Option<usize> {
  function disconnect (line 486) | pub(crate) fn disconnect(&self) -> bool {
  function is_disconnected (line 499) | pub(crate) fn is_disconnected(&self) -> bool {
  function is_empty (line 504) | pub(crate) fn is_empty(&self) -> bool {
  function is_full (line 516) | pub(crate) fn is_full(&self) -> bool {
  method drop (line 529) | fn drop(&mut self) {
  type Receiver (line 568) | pub(crate) struct Receiver<'a, T>(&'a Channel<T>);
  type Sender (line 571) | pub(crate) struct Sender<'a, T>(&'a Channel<T>);
  method try_select (line 574) | fn try_select(&self, token: &mut Token) -> bool {
  method deadline (line 578) | fn deadline(&self) -> Option<Instant> {
  method register (line 582) | fn register(&self, oper: Operation, cx: &Context) -> bool {
  method unregister (line 587) | fn unregister(&self, oper: Operation) {
  method accept (line 591) | fn accept(&self, token: &mut Token, _cx: &Context) -> bool {
  method is_ready (line 595) | fn is_ready(&self) -> bool {
  method watch (line 599) | fn watch(&self, oper: Operation, cx: &Context) -> bool {
  method unwatch (line 604) | fn unwatch(&self, oper: Operation) {
  method try_select (line 610) | fn try_select(&self, token: &mut Token) -> bool {
  method deadline (line 614) | fn deadline(&self) -> Option<Instant> {
  method register (line 618) | fn register(&self, oper: Operation, cx: &Context) -> bool {
  method unregister (line 623) | fn unregister(&self, oper: Operation) {
  method accept (line 627) | fn accept(&self, token: &mut Token, _cx: &Context) -> bool {
  method is_ready (line 631) | fn is_ready(&self) -> bool {
  method watch (line 635) | fn watch(&self, oper: Operation, cx: &Context) -> bool {
  method unwatch (line 640) | fn unwatch(&self, oper: Operation) {

FILE: crossbeam-channel/src/flavors/at.rs
  type AtToken (line 16) | pub(crate) type AtToken = Option<Instant>;
  type Channel (line 19) | pub(crate) struct Channel {
    method new_deadline (line 30) | pub(crate) fn new_deadline(when: Instant) -> Self {
    method try_recv (line 39) | pub(crate) fn try_recv(&self) -> Result<Instant, TryRecvError> {
    method recv (line 63) | pub(crate) fn recv(&self, deadline: Option<Instant>) -> Result<Instant...
    method read (line 102) | pub(crate) unsafe fn read(&self, token: &mut Token) -> Result<Instant,...
    method is_empty (line 108) | pub(crate) fn is_empty(&self) -> bool {
    method is_full (line 126) | pub(crate) fn is_full(&self) -> bool {
    method len (line 132) | pub(crate) fn len(&self) -> usize {
    method capacity (line 138) | pub(crate) fn capacity(&self) -> Option<usize> {
  method try_select (line 145) | fn try_select(&self, token: &mut Token) -> bool {
  method deadline (line 160) | fn deadline(&self) -> Option<Instant> {
  method register (line 170) | fn register(&self, _oper: Operation, _cx: &Context) -> bool {
  method unregister (line 175) | fn unregister(&self, _oper: Operation) {}
  method accept (line 178) | fn accept(&self, token: &mut Token, _cx: &Context) -> bool {
  method is_ready (line 183) | fn is_ready(&self) -> bool {
  method watch (line 188) | fn watch(&self, _oper: Operation, _cx: &Context) -> bool {
  method unwatch (line 193) | fn unwatch(&self, _oper: Operation) {}

FILE: crossbeam-channel/src/flavors/list.rs
  constant WRITE (line 34) | const WRITE: usize = 1;
  constant READ (line 35) | const READ: usize = 2;
  constant DESTROY (line 36) | const DESTROY: usize = 4;
  constant LAP (line 39) | const LAP: usize = 32;
  constant BLOCK_CAP (line 41) | const BLOCK_CAP: usize = LAP - 1;
  constant SHIFT (line 43) | const SHIFT: usize = 1;
  constant MARK_BIT (line 47) | const MARK_BIT: usize = 1;
  type Slot (line 50) | struct Slot<T> {
  function wait_write (line 60) | fn wait_write(&self) {
  type Block (line 71) | struct Block<T> {
  constant LAYOUT (line 80) | const LAYOUT: Layout = {
  function new (line 90) | fn new() -> Box<Self> {
  function wait_next (line 108) | fn wait_next(&self) -> *mut Self {
  function destroy (line 120) | unsafe fn destroy(this: *mut Self, start: usize) {
  type Position (line 142) | struct Position<T> {
  type ListToken (line 152) | pub(crate) struct ListToken {
  method default (line 162) | fn default() -> Self {
  type Channel (line 177) | pub(crate) struct Channel<T> {
  function new (line 193) | pub(crate) fn new() -> Self {
  function receiver (line 209) | pub(crate) fn receiver(&self) -> Receiver<'_, T> {
  function sender (line 214) | pub(crate) fn sender(&self) -> Sender<'_, T> {
  function start_send (line 219) | fn start_send(&self, token: &mut Token) -> bool {
  function write (line 302) | pub(crate) unsafe fn write(&self, token: &mut Token, msg: T) -> Result<(...
  function start_recv (line 321) | fn start_recv(&self, token: &mut Token) -> bool {
  function read (line 406) | pub(crate) unsafe fn read(&self, token: &mut Token) -> Result<T, ()> {
  function try_send (line 433) | pub(crate) fn try_send(&self, msg: T) -> Result<(), TrySendError<T>> {
  function send (line 441) | pub(crate) fn send(
  function try_recv (line 455) | pub(crate) fn try_recv(&self) -> Result<T, TryRecvError> {
  function recv (line 466) | pub(crate) fn recv(&self, deadline: Option<Instant>) -> Result<T, RecvTi...
  function len (line 518) | pub(crate) fn len(&self) -> usize {
  function capacity (line 554) | pub(crate) fn capacity(&self) -> Option<usize> {
  function disconnect_senders (line 561) | pub(crate) fn disconnect_senders(&self) -> bool {
  function disconnect_receivers (line 575) | pub(crate) fn disconnect_receivers(&self) -> bool {
  function discard_all_messages (line 591) | fn discard_all_messages(&self) {
  function is_disconnected (line 656) | pub(crate) fn is_disconnected(&self) -> bool {
  function is_empty (line 661) | pub(crate) fn is_empty(&self) -> bool {
  function is_full (line 668) | pub(crate) fn is_full(&self) -> bool {
  method drop (line 674) | fn drop(&mut self) {
  type Receiver (line 711) | pub(crate) struct Receiver<'a, T>(&'a Channel<T>);
  type Sender (line 714) | pub(crate) struct Sender<'a, T>(&'a Channel<T>);
  method try_select (line 717) | fn try_select(&self, token: &mut Token) -> bool {
  method deadline (line 721) | fn deadline(&self) -> Option<Instant> {
  method register (line 725) | fn register(&self, oper: Operation, cx: &Context) -> bool {
  method unregister (line 730) | fn unregister(&self, oper: Operation) {
  method accept (line 734) | fn accept(&self, token: &mut Token, _cx: &Context) -> bool {
  method is_ready (line 738) | fn is_ready(&self) -> bool {
  method watch (line 742) | fn watch(&self, oper: Operation, cx: &Context) -> bool {
  method unwatch (line 747) | fn unwatch(&self, oper: Operation) {
  method try_select (line 753) | fn try_select(&self, token: &mut Token) -> bool {
  method deadline (line 757) | fn deadline(&self) -> Option<Instant> {
  method register (line 761) | fn register(&self, _oper: Operation, _cx: &Context) -> bool {
  method unregister (line 765) | fn unregister(&self, _oper: Operation) {}
  method accept (line 767) | fn accept(&self, token: &mut Token, _cx: &Context) -> bool {
  method is_ready (line 771) | fn is_ready(&self) -> bool {
  method watch (line 775) | fn watch(&self, _oper: Operation, _cx: &Context) -> bool {
  method unwatch (line 779) | fn unwatch(&self, _oper: Operation) {}

FILE: crossbeam-channel/src/flavors/never.rs
  type NeverToken (line 16) | pub(crate) type NeverToken = ();
  type Channel (line 19) | pub(crate) struct Channel<T> {
  function new (line 26) | pub(crate) fn new() -> Self {
  function try_recv (line 34) | pub(crate) fn try_recv(&self) -> Result<T, TryRecvError> {
  function recv (line 40) | pub(crate) fn recv(&self, deadline: Option<Instant>) -> Result<T, RecvTi...
  function read (line 47) | pub(crate) unsafe fn read(&self, _token: &mut Token) -> Result<T, ()> {
  function is_empty (line 53) | pub(crate) fn is_empty(&self) -> bool {
  function is_full (line 59) | pub(crate) fn is_full(&self) -> bool {
  function len (line 65) | pub(crate) fn len(&self) -> usize {
  function capacity (line 71) | pub(crate) fn capacity(&self) -> Option<usize> {
  method try_select (line 78) | fn try_select(&self, _token: &mut Token) -> bool {
  method deadline (line 83) | fn deadline(&self) -> Option<Instant> {
  method register (line 88) | fn register(&self, _oper: Operation, _cx: &Context) -> bool {
  method unregister (line 93) | fn unregister(&self, _oper: Operation) {}
  method accept (line 96) | fn accept(&self, token: &mut Token, _cx: &Context) -> bool {
  method is_ready (line 101) | fn is_ready(&self) -> bool {
  method watch (line 106) | fn watch(&self, _oper: Operation, _cx: &Context) -> bool {
  method unwatch (line 111) | fn unwatch(&self, _oper: Operation) {}

FILE: crossbeam-channel/src/flavors/tick.rs
  type TickToken (line 17) | pub(crate) type TickToken = Option<Instant>;
  type Align (line 36) | struct Align<T>(T);
  function is_lock_free (line 39) | fn is_lock_free() {
  type Channel (line 61) | pub(crate) struct Channel {
    method new (line 72) | pub(crate) fn new(delivery_time: Instant, dur: Duration) -> Self {
    method try_recv (line 81) | pub(crate) fn try_recv(&self) -> Result<Instant, TryRecvError> {
    method recv (line 102) | pub(crate) fn recv(&self, deadline: Option<Instant>) -> Result<Instant...
    method read (line 134) | pub(crate) unsafe fn read(&self, token: &mut Token) -> Result<Instant,...
    method is_empty (line 140) | pub(crate) fn is_empty(&self) -> bool {
    method is_full (line 146) | pub(crate) fn is_full(&self) -> bool {
    method len (line 152) | pub(crate) fn len(&self) -> usize {
    method capacity (line 158) | pub(crate) fn capacity(&self) -> Option<usize> {
  method try_select (line 165) | fn try_select(&self, token: &mut Token) -> bool {
  method deadline (line 180) | fn deadline(&self) -> Option<Instant> {
  method register (line 185) | fn register(&self, _oper: Operation, _cx: &Context) -> bool {
  method unregister (line 190) | fn unregister(&self, _oper: Operation) {}
  method accept (line 193) | fn accept(&self, token: &mut Token, _cx: &Context) -> bool {
  method is_ready (line 198) | fn is_ready(&self) -> bool {
  method watch (line 203) | fn watch(&self, _oper: Operation, _cx: &Context) -> bool {
  method unwatch (line 208) | fn unwatch(&self, _oper: Operation) {}

FILE: crossbeam-channel/src/flavors/zero.rs
  type ZeroToken (line 25) | pub(crate) struct ZeroToken(*mut ());
    method fmt (line 34) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  method default (line 28) | fn default() -> Self {
  type Packet (line 40) | struct Packet<T> {
  function empty_on_stack (line 53) | fn empty_on_stack() -> Self {
  function empty_on_heap (line 62) | fn empty_on_heap() -> Box<Self> {
  function message_on_stack (line 71) | fn message_on_stack(msg: T) -> Self {
  function wait_ready (line 80) | fn wait_ready(&self) {
  type Inner (line 89) | struct Inner {
  type Channel (line 101) | pub(crate) struct Channel<T> {
  function new (line 111) | pub(crate) fn new() -> Self {
  function receiver (line 123) | pub(crate) fn receiver(&self) -> Receiver<'_, T> {
  function sender (line 128) | pub(crate) fn sender(&self) -> Sender<'_, T> {
  function start_send (line 133) | fn start_send(&self, token: &mut Token) -> bool {
  function write (line 149) | pub(crate) unsafe fn write(&self, token: &mut Token, msg: T) -> Result<(...
  function start_recv (line 162) | fn start_recv(&self, token: &mut Token) -> bool {
  function read (line 178) | pub(crate) unsafe fn read(&self, token: &mut Token) -> Result<T, ()> {
  function try_send (line 204) | pub(crate) fn try_send(&self, msg: T) -> Result<(), TrySendError<T>> {
  function send (line 224) | pub(crate) fn send(
  function try_recv (line 281) | pub(crate) fn try_recv(&self) -> Result<T, TryRecvError> {
  function recv (line 298) | pub(crate) fn recv(&self, deadline: Option<Instant>) -> Result<T, RecvTi...
  function disconnect (line 362) | pub(crate) fn disconnect(&self) -> bool {
  function len (line 376) | pub(crate) fn len(&self) -> usize {
  function capacity (line 381) | pub(crate) fn capacity(&self) -> Option<usize> {
  function is_empty (line 386) | pub(crate) fn is_empty(&self) -> bool {
  function is_full (line 391) | pub(crate) fn is_full(&self) -> bool {
  type Receiver (line 397) | pub(crate) struct Receiver<'a, T>(&'a Channel<T>);
  type Sender (line 400) | pub(crate) struct Sender<'a, T>(&'a Channel<T>);
  method try_select (line 403) | fn try_select(&self, token: &mut Token) -> bool {
  method deadline (line 407) | fn deadline(&self) -> Option<Instant> {
  method register (line 411) | fn register(&self, oper: Operation, cx: &Context) -> bool {
  method unregister (line 422) | fn unregister(&self, oper: Operation) {
  method accept (line 430) | fn accept(&self, token: &mut Token, cx: &Context) -> bool {
  method is_ready (line 435) | fn is_ready(&self) -> bool {
  method watch (line 440) | fn watch(&self, oper: Operation, cx: &Context) -> bool {
  method unwatch (line 446) | fn unwatch(&self, oper: Operation) {
  method try_select (line 453) | fn try_select(&self, token: &mut Token) -> bool {
  method deadline (line 457) | fn deadline(&self) -> Option<Instant> {
  method register (line 461) | fn register(&self, oper: Operation, cx: &Context) -> bool {
  method unregister (line 472) | fn unregister(&self, oper: Operation) {
  method accept (line 480) | fn accept(&self, token: &mut Token, cx: &Context) -> bool {
  method is_ready (line 485) | fn is_ready(&self) -> bool {
  method watch (line 490) | fn watch(&self, oper: Operation, cx: &Context) -> bool {
  method unwatch (line 496) | fn unwatch(&self, oper: Operation) {

FILE: crossbeam-channel/src/select.rs
  type Token (line 24) | pub struct Token {
  type Operation (line 36) | pub struct Operation(usize);
    method hook (line 45) | pub fn hook<T>(r: &mut T) -> Self {
  type Selected (line 56) | pub enum Selected {
    method from (line 72) | fn from(val: usize) -> Self {
  function from (line 84) | fn from(val: Selected) -> Self {
  type SelectHandle (line 99) | pub trait SelectHandle {
    method try_select (line 101) | fn try_select(&self, token: &mut Token) -> bool;
    method deadline (line 104) | fn deadline(&self) -> Option<Instant>;
    method register (line 107) | fn register(&self, oper: Operation, cx: &Context) -> bool;
    method unregister (line 110) | fn unregister(&self, oper: Operation);
    method accept (line 113) | fn accept(&self, token: &mut Token, cx: &Context) -> bool;
    method is_ready (line 116) | fn is_ready(&self) -> bool;
    method watch (line 119) | fn watch(&self, oper: Operation, cx: &Context) -> bool;
    method unwatch (line 122) | fn unwatch(&self, oper: Operation);
    method try_select (line 126) | fn try_select(&self, token: &mut Token) -> bool {
    method deadline (line 130) | fn deadline(&self) -> Option<Instant> {
    method register (line 134) | fn register(&self, oper: Operation, cx: &Context) -> bool {
    method unregister (line 138) | fn unregister(&self, oper: Operation) {
    method accept (line 142) | fn accept(&self, token: &mut Token, cx: &Context) -> bool {
    method is_ready (line 146) | fn is_ready(&self) -> bool {
    method watch (line 150) | fn watch(&self, oper: Operation, cx: &Context) -> bool {
    method unwatch (line 154) | fn unwatch(&self, oper: Operation) {
  type Timeout (line 161) | enum Timeout {
  function run_select (line 176) | fn run_select(
  function run_ready (line 327) | fn run_ready(
  function try_select (line 456) | pub fn try_select<'a>(
  function select (line 474) | pub fn select<'a>(
  function select_timeout (line 494) | pub fn select_timeout<'a>(
  function select_deadline (line 507) | pub(crate) fn select_deadline<'a>(
  function sender_addr (line 524) | pub fn sender_addr<T>(s: &Sender<T>) -> usize {
  function receiver_addr (line 528) | pub fn receiver_addr<T>(s: &Receiver<T>) -> usize {
  type Select (line 616) | pub struct Select<'a> {
  function new (line 643) | pub fn new() -> Self {
  function new_biased (line 665) | pub fn new_biased() -> Self {
  function send (line 686) | pub fn send<T>(&mut self, s: &'a Sender<T>) -> usize {
  function recv (line 708) | pub fn recv<T>(&mut self, r: &'a Receiver<T>) -> usize {
  function remove (line 752) | pub fn remove(&mut self, index: usize) {
  function try_select (line 809) | pub fn try_select(&mut self) -> Result<SelectedOperation<'a>, TrySelectE...
  function select (line 860) | pub fn select(&mut self) -> SelectedOperation<'a> {
  function select_timeout (line 911) | pub fn select_timeout(
  function select_deadline (line 967) | pub fn select_deadline(
  function try_ready (line 1009) | pub fn try_ready(&mut self) -> Result<usize, TryReadyError> {
  function ready (line 1062) | pub fn ready(&mut self) -> usize {
  function ready_timeout (line 1114) | pub fn ready_timeout(&mut self, timeout: Duration) -> Result<usize, Read...
  function ready_deadline (line 1167) | pub fn ready_deadline(&mut self, deadline: Instant) -> Result<usize, Rea...
  method clone (line 1176) | fn clone(&self) -> Self {
  method default (line 1186) | fn default() -> Self {
  function fmt (line 1192) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  type SelectedOperation (line 1209) | pub struct SelectedOperation<'a> {
  function index (line 1248) | pub fn index(&self) -> usize {
  function send (line 1276) | pub fn send<T>(mut self, s: &Sender<T>, msg: T) -> Result<(), SendError<...
  function recv (line 1310) | pub fn recv<T>(mut self, r: &Receiver<T>) -> Result<T, RecvError> {
  function fmt (line 1322) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  method drop (line 1328) | fn drop(&mut self) {

FILE: crossbeam-channel/src/utils.rs
  function shuffle (line 7) | pub(crate) fn shuffle<T>(v: &mut [T]) {
  function sleep_until (line 43) | pub(crate) fn sleep_until(deadline: Option<Instant>) {

FILE: crossbeam-channel/src/waker.rs
  type Entry (line 19) | pub(crate) struct Entry {
  type Waker (line 34) | pub(crate) struct Waker {
    method new (line 45) | pub(crate) fn new() -> Self {
    method register (line 54) | pub(crate) fn register(&mut self, oper: Operation, cx: &Context) {
    method register_with_packet (line 60) | pub(crate) fn register_with_packet(&mut self, oper: Operation, packet:...
    method unregister (line 70) | pub(crate) fn unregister(&mut self, oper: Operation) -> Option<Entry> {
    method try_select (line 86) | pub(crate) fn try_select(&mut self) -> Option<Entry> {
    method can_select (line 117) | pub(crate) fn can_select(&self) -> bool {
    method watch (line 131) | pub(crate) fn watch(&mut self, oper: Operation, cx: &Context) {
    method unwatch (line 141) | pub(crate) fn unwatch(&mut self, oper: Operation) {
    method notify (line 147) | pub(crate) fn notify(&mut self) {
    method disconnect (line 157) | pub(crate) fn disconnect(&mut self) {
  method drop (line 175) | fn drop(&mut self) {
  type SyncWaker (line 184) | pub(crate) struct SyncWaker {
    method new (line 195) | pub(crate) fn new() -> Self {
    method register (line 204) | pub(crate) fn register(&self, oper: Operation, cx: &Context) {
    method unregister (line 215) | pub(crate) fn unregister(&self, oper: Operation) -> Option<Entry> {
    method notify (line 227) | pub(crate) fn notify(&self) {
    method watch (line 243) | pub(crate) fn watch(&self, oper: Operation, cx: &Context) {
    method unwatch (line 254) | pub(crate) fn unwatch(&self, oper: Operation) {
    method disconnect (line 265) | pub(crate) fn disconnect(&self) {
  method drop (line 277) | fn drop(&mut self) {
  function current_thread_id (line 284) | fn current_thread_id() -> ThreadId {

FILE: crossbeam-channel/tests/after.rs
  function ms (line 14) | fn ms(ms: u64) -> Duration {
  function fire (line 19) | fn fire() {
  function capacity (line 48) | fn capacity() {
  function len_empty_full (line 58) | fn len_empty_full() {
  function try_recv (line 80) | fn try_recv() {
  function recv (line 97) | fn recv() {
  function recv_timeout (line 114) | fn recv_timeout() {
  function recv_two (line 136) | fn recv_two() {
  function recv_race (line 159) | fn recv_race() {
  function stress_default (line 172) | fn stress_default() {
  function select (line 191) | fn select() {
  function ready (line 235) | fn ready() {
  function stress_clone (line 278) | fn stress_clone() {
  function fairness (line 304) | fn fairness() {
  function fairness_duplicates (line 322) | fn fairness_duplicates() {

FILE: crossbeam-channel/tests/array.rs
  function ms (line 16) | fn ms(ms: u64) -> Duration {
  function smoke (line 21) | fn smoke() {
  function capacity (line 34) | fn capacity() {
  function len_empty_full (line 43) | fn len_empty_full() {
  function try_recv (line 82) | fn try_recv() {
  function recv (line 102) | fn recv() {
  function recv_timeout (line 125) | fn recv_timeout() {
  function try_send (line 146) | fn try_send() {
  function send (line 169) | fn send() {
  function send_timeout (line 193) | fn send_timeout() {
  function send_after_disconnect (line 221) | fn send_after_disconnect() {
  function recv_after_disconnect (line 239) | fn recv_after_disconnect() {
  function len (line 255) | fn len() {
  function disconnect_wakes_sender (line 315) | fn disconnect_wakes_sender() {
  function disconnect_wakes_receiver (line 332) | fn disconnect_wakes_receiver() {
  function spsc (line 348) | fn spsc() {
  function mpmc (line 370) | fn mpmc() {
  function stress_oneshot (line 402) | fn stress_oneshot() {
  function stress_iter (line 417) | fn stress_iter() {
  function stress_timeout_two_threads (line 447) | fn stress_timeout_two_threads() {
  function drops (line 484) | fn drops() {
  function linearizable (line 535) | fn linearizable() {
  function fairness (line 555) | fn fairness() {
  function fairness_duplicates (line 577) | fn fairness_duplicates() {
  function recv_in_send (line 600) | fn recv_in_send() {
  function channel_through_channel (line 621) | fn channel_through_channel() {
  function panic_on_drop (line 659) | fn panic_on_drop() {

FILE: crossbeam-channel/tests/golang.rs
  function ms (line 29) | fn ms(ms: u64) -> Duration {
  type Chan (line 33) | struct Chan<T> {
  type ChanInner (line 37) | struct ChanInner<T> {
  method clone (line 49) | fn clone(&self) -> Self {
  function send (line 57) | fn send(&self, msg: T) {
  function try_recv (line 69) | fn try_recv(&self) -> Option<T> {
  function recv (line 74) | fn recv(&self) -> Option<T> {
  function close_s (line 79) | fn close_s(&self) {
  function close_r (line 88) | fn close_r(&self) {
  function has_rx (line 97) | fn has_rx(&self) -> bool {
  function has_tx (line 101) | fn has_tx(&self) -> bool {
  function rx (line 105) | fn rx(&self) -> Receiver<T> {
  function tx (line 113) | fn tx(&self) -> Sender<T> {
  type Item (line 123) | type Item = T;
  method next (line 125) | fn next(&mut self) -> Option<Self::Item> {
  type Item (line 131) | type Item = T;
  type IntoIter (line 132) | type IntoIter = Chan<T>;
  method into_iter (line 134) | fn into_iter(self) -> Self::IntoIter {
  function make (line 139) | fn make<T>(cap: usize) -> Chan<T> {
  function make_unbounded (line 153) | fn make_unbounded<T>() -> Chan<T> {
  type WaitGroup (line 168) | struct WaitGroup(Arc<WaitGroupInner>);
    method new (line 176) | fn new() -> Self {
    method add (line 183) | fn add(&self, delta: i32) {
    method done (line 190) | fn done(&self) {
    method wait (line 194) | fn wait(&self) {
  type WaitGroupInner (line 170) | struct WaitGroupInner {
  type Defer (line 202) | struct Defer<F: FnOnce()> {
  method drop (line 207) | fn drop(&mut self) {
  type Counter (line 215) | struct Counter;
  method alloc (line 219) | unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
  method dealloc (line 227) | unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) {
  constant ITERATIONS (line 272) | const ITERATIONS: i32 = if cfg!(miri) { 100 } else { 10_000 };
  function sender (line 274) | fn sender(n: i32, c1: Chan<i32>, c2: Chan<i32>, c3: Chan<i32>, c4: Chan<...
  function mux (line 290) | fn mux(out: Chan<i32>, inp: Chan<i32>, done: Chan<bool>) {
  function recver (line 297) | fn recver(inp: Chan<i32>) {
  function main (line 309) | fn main() {
  constant N (line 337) | const N: i32 = 10;
  function asynch_fifo (line 340) | fn asynch_fifo() {
  function chain (line 352) | fn chain(ch: Chan<i32>, val: i32, inp: Chan<i32>, out: Chan<i32>) {
  function synch_fifo (line 361) | fn synch_fifo() {
  function f (line 384) | fn f(left: Chan<i32>, right: Chan<i32>) {
  function main (line 389) | fn main() {
  function i32receiver (line 411) | fn i32receiver(c: Chan<i32>, strobe: Chan<bool>) {
  function i32sender (line 418) | fn i32sender(c: Chan<i32>, strobe: Chan<bool>) {
  function i64receiver (line 423) | fn i64receiver(c: Chan<i64>, strobe: Chan<bool>) {
  function i64sender (line 430) | fn i64sender(c: Chan<i64>, strobe: Chan<bool>) {
  function breceiver (line 435) | fn breceiver(c: Chan<bool>, strobe: Chan<bool>) {
  function bsender (line 442) | fn bsender(c: Chan<bool>, strobe: Chan<bool>) {
  function sreceiver (line 447) | fn sreceiver(c: Chan<String>, strobe: Chan<bool>) {
  function ssender (line 454) | fn ssender(c: Chan<String>, strobe: Chan<bool>) {
  constant MAX_TRIES (line 459) | const MAX_TRIES: usize = 10000;
  function main (line 462) | fn main() {
  function main (line 680) | fn main() {
  constant N (line 731) | const N: i32 = if cfg!(miri) { 200 } else { 100000 };
  function main (line 734) | fn main() {
  function main (line 779) | fn main() {
  function main (line 795) | fn main() {
  function recv1 (line 820) | fn recv1(c: Chan<i32>) {
  function recv2 (line 824) | fn recv2(c: Chan<i32>) {
  function recv3 (line 830) | fn recv3(c: Chan<i32>) {
  function send1 (line 838) | fn send1(recv: fn(Chan<i32>)) {
  function send2 (line 845) | fn send2(recv: fn(Chan<i32>)) {
  function send3 (line 854) | fn send3(recv: fn(Chan<i32>)) {
  function main (line 866) | fn main() {
  function generate (line 888) | fn generate(ch: Chan<i32>) {
  function filter (line 896) | fn filter(in_ch: Chan<i32>, out_ch: Chan<i32>, prime: i32) {
  function sieve (line 904) | fn sieve(primes: Chan<i32>) {
  function main (line 918) | fn main() {
  function zero_size_struct (line 949) | fn zero_size_struct() {
  function zero_size_array (line 955) | fn zero_size_array() {
  function test_chan (line 965) | fn test_chan() {
  function test_nonblock_recv_race (line 1106) | fn test_nonblock_recv_race() {
  function test_nonblock_select_race (line 1127) | fn test_nonblock_select_race() {
  function test_nonblock_select_race2 (line 1160) | fn test_nonblock_select_race2() {
  function test_self_select (line 1193) | fn test_self_select() {
  function test_select_stress (line 1235) | fn test_select_stress() {
  function test_select_fairness (line 1341) | fn test_select_fairness() {
  function test_chan_send_interface (line 1405) | fn test_chan_send_interface() {
  function test_pseudo_random_send (line 1424) | fn test_pseudo_random_send() {
  function test_multi_consumer (line 1466) | fn test_multi_consumer() {
  function test_select_duplicate_channel (line 1515) | fn test_select_duplicate_channel() {
  constant MESSAGES_PER_CHANEL (line 1560) | const MESSAGES_PER_CHANEL: u32 = 76;
  constant MESSAGES_RANGE_LEN (line 1561) | const MESSAGES_RANGE_LEN: u32 = 100;
  constant END (line 1562) | const END: i32 = 10000;
  type ChanWithVals (line 1564) | struct ChanWithVals {
    method with_capacity (line 1588) | fn with_capacity(capacity: usize) -> Self {
    method closed (line 1596) | fn closed() -> Self {
    method rv (line 1603) | fn rv(&self) -> i32 {
    method sv (line 1607) | fn sv(&self) -> i32 {
    method send (line 1611) | fn send(&mut self, tot: &Mutex<Totals>) -> bool {
    method recv (line 1625) | fn recv(&mut self, v: i32, tot: &Mutex<Totals>) -> bool {
  type Totals (line 1572) | struct Totals {
  type Context (line 1579) | struct Context {
    method nproc (line 1651) | fn nproc(&self) -> &Mutex<i32> {
    method cval (line 1655) | fn cval(&self) -> &Mutex<i32> {
    method tot (line 1659) | fn tot(&self) -> &Mutex<Totals> {
    method randx (line 1663) | fn randx(&self) -> &Mutex<i32> {
  method clone (line 1641) | fn clone(&self) -> Self {
  method clone (line 1669) | fn clone(&self) -> Self {
  function nrand (line 1680) | fn nrand(n: i32, randx: &Mutex<i32>) -> i32 {
  function change_nproc (line 1689) | fn change_nproc(adjust: i32, nproc: &Mutex<i32>) -> i32 {
  function mkchan (line 1695) | fn mkchan(c: usize, n: usize, cval: &Mutex<i32>) -> Vec<ChanWithVals> {
  function expect (line 1708) | fn expect(v: i32, v0: i32) -> i32 {
  function send (line 1719) | fn send(mut c: ChanWithVals, ctx: Context) {
  function recv (line 1732) | fn recv(mut c: ChanWithVals, ctx: Context) {
  function sel (line 1746) | fn sel(
  function get (line 1805) | fn get(vec: &[ChanWithVals], idx: usize) -> ChanWithVals {
  function test1 (line 1810) | fn test1(c: ChanWithVals, ctx: &mut Context) {
  function test2 (line 1817) | fn test2(c: usize, ctx: &mut Context) {
  function test3 (line 1845) | fn test3(c: usize, ctx: &mut Context) {
  function test4 (line 1873) | fn test4(c: usize, ctx: &mut Context) {
  function test5 (line 1910) | fn test5(c: usize, ctx: &mut Context) {
  function test6 (line 1947) | fn test6(c: usize, ctx: &mut Context) {
  function wait (line 1995) | fn wait(ctx: &mut Context) {
  function tests (line 2002) | fn tests(c: usize, ctx: &mut Context) {
  function main (line 2028) | fn main() {
  constant N (line 2061) | const N: usize = if cfg!(miri) { 20 } else { 1000 };
  constant M (line 2063) | const M: usize = 10;
  constant W (line 2065) | const W: usize = 2;
  function r (line 2067) | fn r(c: Chan<usize>, m: usize, h: Arc<Mutex<[usize; N]>>) {
  function s (line 2083) | fn s(c: Chan<usize>, h: Arc<Mutex<[usize; N]>>) {
  function main (line 2099) | fn main() {

FILE: crossbeam-channel/tests/iter.rs
  function nested_recv_iter (line 7) | fn nested_recv_iter() {
  function recv_iter_break (line 30) | fn recv_iter_break() {
  function recv_try_iter (line 58) | fn recv_try_iter() {
  function recv_into_iter_owned (line 86) | fn recv_into_iter_owned() {
  function recv_into_iter_borrowed (line 100) | fn recv_into_iter_borrowed() {

FILE: crossbeam-channel/tests/list.rs
  function ms (line 16) | fn ms(ms: u64) -> Duration {
  function smoke (line 21) | fn smoke() {
  function capacity (line 34) | fn capacity() {
  function len_empty_full (line 41) | fn len_empty_full() {
  function try_recv (line 72) | fn try_recv() {
  function recv (line 92) | fn recv() {
  function recv_timeout (line 115) | fn recv_timeout() {
  function try_send (line 136) | fn try_send() {
  function send (line 149) | fn send() {
  function send_timeout (line 162) | fn send_timeout() {
  function send_after_disconnect (line 178) | fn send_after_disconnect() {
  function recv_after_disconnect (line 196) | fn recv_after_disconnect() {
  function len (line 212) | fn len() {
  function disconnect_wakes_receiver (line 233) | fn disconnect_wakes_receiver() {
  function spsc (line 249) | fn spsc() {
  function mpmc (line 271) | fn mpmc() {
  function stress_oneshot (line 305) | fn stress_oneshot() {
  function stress_iter (line 320) | fn stress_iter() {
  function stress_timeout_two_threads (line 350) | fn stress_timeout_two_threads() {
  function drops (line 383) | fn drops() {
  function linearizable (line 434) | fn linearizable() {
  function fairness (line 454) | fn fairness() {
  function fairness_duplicates (line 476) | fn fairness_duplicates() {
  function recv_in_send (line 499) | fn recv_in_send() {
  function channel_through_channel (line 509) | fn channel_through_channel() {
  function stack_overflow (line 549) | fn stack_overflow() {

FILE: crossbeam-channel/tests/mpsc.rs
  type Sender (line 33) | struct Sender<T> {
  function send (line 38) | fn send(&self, t: T) -> Result<(), SendError<T>> {
  method clone (line 44) | fn clone(&self) -> Self {
  type SyncSender (line 51) | struct SyncSender<T> {
  function send (line 56) | fn send(&self, t: T) -> Result<(), SendError<T>> {
  function try_send (line 60) | fn try_send(&self, t: T) -> Result<(), TrySendError<T>> {
  method clone (line 69) | fn clone(&self) -> Self {
  type Receiver (line 76) | struct Receiver<T> {
  function try_recv (line 81) | fn try_recv(&self) -> Result<T, TryRecvError> {
  function recv (line 88) | fn recv(&self) -> Result<T, RecvError> {
  function recv_timeout (line 92) | fn recv_timeout(&self, timeout: Duration) -> Result<T, RecvTimeoutError> {
  function iter (line 99) | fn iter(&self) -> Iter<'_, T> {
  function try_iter (line 103) | fn try_iter(&self) -> TryIter<'_, T> {
  type Item (line 109) | type Item = T;
  type IntoIter (line 110) | type IntoIter = Iter<'a, T>;
  method into_iter (line 112) | fn into_iter(self) -> Self::IntoIter {
  type Item (line 118) | type Item = T;
  type IntoIter (line 119) | type IntoIter = IntoIter<T>;
  method into_iter (line 121) | fn into_iter(self) -> Self::IntoIter {
  type TryIter (line 126) | struct TryIter<'a, T> {
  type Item (line 131) | type Item = T;
  method next (line 133) | fn next(&mut self) -> Option<Self::Item> {
  type Iter (line 138) | struct Iter<'a, T> {
  type Item (line 143) | type Item = T;
  method next (line 145) | fn next(&mut self) -> Option<Self::Item> {
  type IntoIter (line 150) | struct IntoIter<T> {
  type Item (line 155) | type Item = T;
  method next (line 157) | fn next(&mut self) -> Option<Self::Item> {
  function channel (line 162) | fn channel<T>() -> (Sender<T>, Receiver<T>) {
  function sync_channel (line 169) | fn sync_channel<T>(bound: usize) -> (SyncSender<T>, Receiver<T>) {
  function stress_factor (line 199) | fn stress_factor() -> usize {
  function smoke (line 207) | fn smoke() {
  function drop_full (line 214) | fn drop_full() {
  function drop_full_shared (line 220) | fn drop_full_shared() {
  function smoke_shared (line 228) | fn smoke_shared() {
  function smoke_threads (line 238) | fn smoke_threads() {
  function smoke_port_gone (line 248) | fn smoke_port_gone() {
  function smoke_shared_port_gone (line 255) | fn smoke_shared_port_gone() {
  function smoke_shared_port_gone2 (line 262) | fn smoke_shared_port_gone2() {
  function port_gone_concurrent (line 271) | fn port_gone_concurrent() {
  function port_gone_concurrent_shared (line 281) | fn port_gone_concurrent_shared() {
  function smoke_chan_gone (line 292) | fn smoke_chan_gone() {
  function smoke_chan_gone_shared (line 299) | fn smoke_chan_gone_shared() {
  function chan_gone_concurrent (line 308) | fn chan_gone_concurrent() {
  function stress (line 319) | fn stress() {
  function stress_shared (line 335) | fn stress_shared() {
  function send_from_outside_runtime (line 365) | fn send_from_outside_runtime() {
  function recv_from_outside_runtime (line 385) | fn recv_from_outside_runtime() {
  function no_runtime (line 399) | fn no_runtime() {
  function oneshot_single_thread_close_port_first (line 415) | fn oneshot_single_thread_close_port_first() {
  function oneshot_single_thread_close_chan_first (line 422) | fn oneshot_single_thread_close_chan_first() {
  function oneshot_single_thread_send_port_close (line 429) | fn oneshot_single_thread_send_port_close() {
  function oneshot_single_thread_recv_chan_close (line 437) | fn oneshot_single_thread_recv_chan_close() {
  function oneshot_single_thread_send_then_recv (line 444) | fn oneshot_single_thread_send_then_recv() {
  function oneshot_single_thread_try_send_open (line 451) | fn oneshot_single_thread_try_send_open() {
  function oneshot_single_thread_try_send_closed (line 458) | fn oneshot_single_thread_try_send_closed() {
  function oneshot_single_thread_try_recv_open (line 465) | fn oneshot_single_thread_try_recv_open() {
  function oneshot_single_thread_try_recv_closed (line 472) | fn oneshot_single_thread_try_recv_closed() {
  function oneshot_single_thread_peek_data (line 479) | fn oneshot_single_thread_peek_data() {
  function oneshot_single_thread_peek_close (line 487) | fn oneshot_single_thread_peek_close() {
  function oneshot_single_thread_peek_open (line 495) | fn oneshot_single_thread_peek_open() {
  function oneshot_multi_task_recv_then_send (line 501) | fn oneshot_multi_task_recv_then_send() {
  function oneshot_multi_task_recv_then_close (line 512) | fn oneshot_multi_task_recv_then_close() {
  function oneshot_multi_thread_close_stress (line 526) | fn oneshot_multi_thread_close_stress() {
  function oneshot_multi_thread_send_close_stress (line 543) | fn oneshot_multi_thread_send_close_stress() {
  function oneshot_multi_thread_recv_close_stress (line 564) | fn oneshot_multi_thread_recv_close_stress() {
  function oneshot_multi_thread_send_recv_stress (line 591) | fn oneshot_multi_thread_send_recv_stress() {
  function stream_send_recv_stress (line 608) | fn stream_send_recv_stress() {
  function oneshot_single_thread_recv_timeout (line 649) | fn oneshot_single_thread_recv_timeout() {
  function stress_recv_timeout_two_threads (line 662) | fn stress_recv_timeout_two_threads() {
  function recv_timeout_upgrade (line 693) | fn recv_timeout_upgrade() {
  function stress_recv_timeout_shared (line 704) | fn stress_recv_timeout_shared() {
  function recv_a_lot (line 739) | fn recv_a_lot() {
  function shared_recv_timeout (line 753) | fn shared_recv_timeout() {
  function shared_chan_stress (line 781) | fn shared_chan_stress() {
  function test_nested_recv_iter (line 802) | fn test_nested_recv_iter() {
  function test_recv_iter_break (line 823) | fn test_recv_iter_break() {
  function test_recv_try_iter (line 849) | fn test_recv_try_iter() {
  function test_recv_into_iter_owned (line 877) | fn test_recv_into_iter_owned() {
  function test_recv_into_iter_borrowed (line 891) | fn test_recv_into_iter_borrowed() {
  function try_recv_states (line 903) | fn try_recv_states() {
  function destroy_upgraded_shared_port_when_sender_still_active (line 930) | fn destroy_upgraded_shared_port_when_sender_still_active() {
  function issue_32114 (line 954) | fn issue_32114() {
  function stress_factor (line 967) | fn stress_factor() -> usize {
  function smoke (line 975) | fn smoke() {
  function drop_full (line 982) | fn drop_full() {
  function smoke_shared (line 988) | fn smoke_shared() {
  function recv_timeout (line 998) | fn recv_timeout() {
  function smoke_threads (line 1009) | fn smoke_threads() {
  function smoke_port_gone (line 1019) | fn smoke_port_gone() {
  function smoke_shared_port_gone2 (line 1026) | fn smoke_shared_port_gone2() {
  function port_gone_concurrent (line 1035) | fn port_gone_concurrent() {
  function port_gone_concurrent_shared (line 1045) | fn port_gone_concurrent_shared() {
  function smoke_chan_gone (line 1056) | fn smoke_chan_gone() {
  function smoke_chan_gone_shared (line 1063) | fn smoke_chan_gone_shared() {
  function chan_gone_concurrent (line 1072) | fn chan_gone_concurrent() {
  function stress (line 1083) | fn stress() {
  function stress_recv_timeout_two_threads (line 1099) | fn stress_recv_timeout_two_threads() {
  function stress_recv_timeout_shared (line 1127) | fn stress_recv_timeout_shared() {
  function stress_shared (line 1173) | fn stress_shared() {
  function oneshot_single_thread_close_port_first (line 1206) | fn oneshot_single_thread_close_port_first() {
  function oneshot_single_thread_close_chan_first (line 1213) | fn oneshot_single_thread_close_chan_first() {
  function oneshot_single_thread_send_port_close (line 1220) | fn oneshot_single_thread_send_port_close() {
  function oneshot_single_thread_recv_chan_close (line 1228) | fn oneshot_single_thread_recv_chan_close() {
  function oneshot_single_thread_send_then_recv (line 1235) | fn oneshot_single_thread_send_then_recv() {
  function oneshot_single_thread_try_send_open (line 1242) | fn oneshot_single_thread_try_send_open() {
  function oneshot_single_thread_try_send_closed (line 1249) | fn oneshot_single_thread_try_send_closed() {
  function oneshot_single_thread_try_send_closed2 (line 1256) | fn oneshot_single_thread_try_send_closed2() {
  function oneshot_single_thread_try_recv_open (line 1262) | fn oneshot_single_thread_try_recv_open() {
  function oneshot_single_thread_try_recv_closed (line 1269) | fn oneshot_single_thread_try_recv_closed() {
  function oneshot_single_thread_try_recv_closed_with_data (line 1276) | fn oneshot_single_thread_try_recv_closed_with_data() {
  function oneshot_single_thread_peek_data (line 1285) | fn oneshot_single_thread_peek_data() {
  function oneshot_single_thread_peek_close (line 1293) | fn oneshot_single_thread_peek_close() {
  function oneshot_single_thread_peek_open (line 1301) | fn oneshot_single_thread_peek_open() {
  function oneshot_multi_task_recv_then_send (line 1307) | fn oneshot_multi_task_recv_then_send() {
  function oneshot_multi_task_recv_then_close (line 1318) | fn oneshot_multi_task_recv_then_close() {
  function oneshot_multi_thread_close_stress (line 1332) | fn oneshot_multi_thread_close_stress() {
  function oneshot_multi_thread_send_close_stress (line 1349) | fn oneshot_multi_thread_send_close_stress() {
  function oneshot_multi_thread_recv_close_stress (line 1370) | fn oneshot_multi_thread_recv_close_stress() {
  function oneshot_multi_thread_send_recv_stress (line 1396) | fn oneshot_multi_thread_send_recv_stress() {
  function stream_send_recv_stress (line 1413) | fn stream_send_recv_stress() {
  function recv_a_lot (line 1454) | fn recv_a_lot() {
  function shared_chan_stress (line 1468) | fn shared_chan_stress() {
  function test_nested_recv_iter (line 1489) | fn test_nested_recv_iter() {
  function test_recv_iter_break (line 1510) | fn test_recv_iter_break() {
  function try_recv_states (line 1536) | fn try_recv_states() {
  function destroy_upgraded_shared_port_when_sender_still_active (line 1563) | fn destroy_upgraded_shared_port_when_sender_still_active() {
  function send1 (line 1587) | fn send1() {
  function send2 (line 1597) | fn send2() {
  function send3 (line 1607) | fn send3() {
  function send4 (line 1618) | fn send4() {
  function try_send1 (line 1639) | fn try_send1() {
  function try_send2 (line 1645) | fn try_send2() {
  function try_send3 (line 1652) | fn try_send3() {
  function issue_15761 (line 1660) | fn issue_15761() {
  function smoke (line 1687) | fn smoke() {
  function smoke2 (line 1712) | fn smoke2() {
  function closed (line 1729) | fn closed() {
  function unblocks (line 1741) | fn unblocks() {
  function both_ready (line 1770) | fn both_ready() {
  function stress (line 1799) | fn stress() {
  function cloning (line 1829) | fn cloning() {
  function cloning2 (line 1853) | fn cloning2() {
  function cloning3 (line 1876) | fn cloning3() {
  function preflight1 (line 1898) | fn preflight1() {
  function preflight2 (line 1907) | fn preflight2() {
  function preflight3 (line 1917) | fn preflight3() {
  function preflight4 (line 1927) | fn preflight4() {
  function preflight5 (line 1936) | fn preflight5() {
  function preflight6 (line 1946) | fn preflight6() {
  function preflight7 (line 1956) | fn preflight7() {
  function preflight8 (line 1965) | fn preflight8() {
  function preflight9 (line 1976) | fn preflight9() {
  function oneshot_data_waiting (line 1988) | fn oneshot_data_waiting() {
  function stream_data_waiting (line 2007) | fn stream_data_waiting() {
  function shared_data_waiting (line 2030) | fn shared_data_waiting() {
  function sync1 (line 2052) | fn sync1() {
  function sync2 (line 2061) | fn sync2() {
  function sync3 (line 2076) | fn sync3() {

FILE: crossbeam-channel/tests/never.rs
  function ms (line 10) | fn ms(ms: u64) -> Duration {
  function smoke (line 15) | fn smoke() {
  function optional (line 23) | fn optional() {
  function tick_n (line 42) | fn tick_n() {
  function capacity (line 61) | fn capacity() {
  function len_empty_full (line 67) | fn len_empty_full() {
  function try_recv (line 75) | fn try_recv() {
  function recv_timeout (line 85) | fn recv_timeout() {

FILE: crossbeam-channel/tests/ready.rs
  function ms (line 15) | fn ms(ms: u64) -> Duration {
  function smoke1 (line 20) | fn smoke1() {
  function smoke2 (line 42) | fn smoke2() {
  function disconnected (line 62) | fn disconnected() {
  function default (line 110) | fn default() {
  function timeout (line 147) | fn timeout() {
  function default_when_disconnected (line 194) | fn default_when_disconnected() {
  function default_only (line 235) | fn default_only() {
  function unblocks (line 252) | fn unblocks() {
  function both_ready (line 295) | fn both_ready() {
  function cloning1 (line 321) | fn cloning1() {
  function cloning2 (line 352) | fn cloning2() {
  function preflight1 (line 377) | fn preflight1() {
  function preflight2 (line 390) | fn preflight2() {
  function preflight3 (line 407) | fn preflight3() {
  function duplicate_operations (line 423) | fn duplicate_operations() {
  function nesting (line 456) | fn nesting() {
  function stress_recv (line 497) | fn stress_recv() {
  function stress_send (line 534) | fn stress_send() {
  function stress_mixed (line 568) | fn stress_mixed() {
  function stress_timeout_two_threads (line 602) | fn stress_timeout_two_threads() {
  function send_recv_same_channel (line 654) | fn send_recv_same_channel() {
  function channel_through_channel (line 673) | fn channel_through_channel() {
  function fairness1 (line 729) | fn fairness1() {
  function fairness2 (line 774) | fn fairness2() {

FILE: crossbeam-channel/tests/same_channel.rs
  function ms (line 7) | fn ms(ms: u64) -> Duration {
  function after_same_channel (line 12) | fn after_same_channel() {
  function array_same_channel (line 28) | fn array_same_channel() {
  function list_same_channel (line 45) | fn list_same_channel() {
  function never_same_channel (line 62) | fn never_same_channel() {
  function tick_same_channel (line 75) | fn tick_same_channel() {
  function zero_same_channel (line 91) | fn zero_same_channel() {
  function different_flavors_same_channel (line 108) | fn different_flavors_same_channel() {

FILE: crossbeam-channel/tests/select.rs
  function ms (line 13) | fn ms(ms: u64) -> Duration {
  function smoke1 (line 18) | fn smoke1() {
  function smoke2 (line 48) | fn smoke2() {
  function disconnected (line 75) | fn disconnected() {
  function default (line 137) | fn default() {
  function timeout (line 195) | fn timeout() {
  function default_when_disconnected (line 263) | fn default_when_disconnected() {
  function default_only (line 319) | fn default_only() {
  function unblocks (line 338) | fn unblocks() {
  function both_ready (line 386) | fn both_ready() {
  function loop_try (line 413) | fn loop_try() {
  function cloning1 (line 513) | fn cloning1() {
  function cloning2 (line 545) | fn cloning2() {
  function preflight1 (line 571) | fn preflight1() {
  function preflight2 (line 585) | fn preflight2() {
  function preflight3 (line 603) | fn preflight3() {
  function duplicate_operations (line 620) | fn duplicate_operations() {
  function nesting (line 654) | fn nesting() {
  function stress_recv (line 699) | fn stress_recv() {
  function stress_send (line 737) | fn stress_send() {
  function stress_mixed (line 772) | fn stress_mixed() {
  function stress_timeout_two_threads (line 807) | fn stress_timeout_two_threads() {
  function send_recv_same_channel (line 865) | fn send_recv_same_channel() {
  function matching (line 896) | fn matching() {
  function matching_with_leftover (line 922) | fn matching_with_leftover() {
  function channel_through_channel (line 949) | fn channel_through_channel() {
  function linearizable_try (line 1007) | fn linearizable_try() {
  function linearizable_timeout (line 1059) | fn linearizable_timeout() {
  function fairness1 (line 1111) | fn fairness1() {
  function fairness2 (line 1157) | fn fairness2() {
  function sync_and_clone (line 1216) | fn sync_and_clone() {
  function send_and_clone (line 1245) | fn send_and_clone() {
  function reuse (line 1273) | fn reuse() {
  function issue_1096 (line 1310) | fn issue_1096() {

FILE: crossbeam-channel/tests/select_macro.rs
  function ms (line 20) | fn ms(ms: u64) -> Duration {
  function smoke1 (line 25) | fn smoke1() {
  function smoke2 (line 45) | fn smoke2() {
  function disconnected (line 64) | fn disconnected() {
  function default (line 106) | fn default() {
  function timeout (line 142) | fn timeout() {
  function default_when_disconnected (line 187) | fn default_when_disconnected() {
  function default_only (line 219) | fn default_only() {
  function unblocks (line 237) | fn unblocks() {
  function both_ready (line 271) | fn both_ready() {
  function loop_try (line 293) | fn loop_try() {
  function cloning1 (line 347) | fn cloning1() {
  function cloning2 (line 374) | fn cloning2() {
  function preflight1 (line 395) | fn preflight1() {
  function preflight2 (line 405) | fn preflight2() {
  function preflight3 (line 418) | fn preflight3() {
  function duplicate_operations (line 431) | fn duplicate_operations() {
  function nesting (line 446) | fn nesting() {
  function panic_sender (line 471) | fn panic_sender() {
  function panic_receiver (line 486) | fn panic_receiver() {
  function stress_recv (line 497) | fn stress_recv() {
  function stress_send (line 530) | fn stress_send() {
  function stress_mixed (line 560) | fn stress_mixed() {
  function stress_timeout_two_threads (line 590) | fn stress_timeout_two_threads() {
  function send_recv_same_channel (line 633) | fn send_recv_same_channel() {
  function matching (line 650) | fn matching() {
  function matching_with_leftover (line 671) | fn matching_with_leftover() {
  function channel_through_channel (line 693) | fn channel_through_channel() {
  function linearizable_default (line 738) | fn linearizable_default() {
  function linearizable_timeout (line 782) | fn linearizable_timeout() {
  function fairness1 (line 826) | fn fairness1() {
  function fairness2 (line 851) | fn fairness2() {
  function fairness_recv (line 888) | fn fairness_recv() {
  function fairness_send (line 910) | fn fairness_send() {
  function unfairness (line 927) | fn unfairness() {
  function unfairness_timeout (line 961) | fn unfairness_timeout() {
  function unfairness_try (line 997) | fn unfairness_try() {
  function references (line 1034) | fn references() {
  function case_blocks (line 1056) | fn case_blocks() {
  function move_handles (line 1082) | fn move_handles() {
  function infer_types (line 1091) | fn infer_types() {
  function default_syntax (line 1107) | fn default_syntax() {
  function same_variable_name (line 1127) | fn same_variable_name() {
  function handles_on_heap (line 1135) | fn handles_on_heap() {
  function once_blocks (line 1150) | fn once_blocks() {
  function once_receiver (line 1186) | fn once_receiver() {
  function once_sender (line 1201) | fn once_sender() {
  function parse_nesting (line 1216) | fn parse_nesting() {
  function evaluate (line 1240) | fn evaluate() {
  function deref (line 1264) | fn deref() {
  function result_types (line 1297) | fn result_types() {
  function try_recv (line 1332) | fn try_recv() {
  function recv (line 1363) | fn recv() {
  function recv_timeout (line 1400) | fn recv_timeout() {
  function try_send (line 1429) | fn try_send() {
  function send (line 1460) | fn send() {
  function send_timeout (line 1494) | fn send_timeout() {
  function disconnect_wakes_sender (line 1523) | fn disconnect_wakes_sender() {
  function disconnect_wakes_receiver (line 1541) | fn disconnect_wakes_receiver() {
  function trailing_comma (line 1559) | fn trailing_comma() {

FILE: crossbeam-channel/tests/thread_locals.rs
  function ms (line 10) | fn ms(ms: u64) -> Duration {
  function use_while_exiting (line 16) | fn use_while_exiting() {

FILE: crossbeam-channel/tests/tick.rs
  function ms (line 14) | fn ms(ms: u64) -> Duration {
  function fire (line 19) | fn fire() {
  function intervals (line 49) | fn intervals() {
  function capacity (line 71) | fn capacity() {
  function len_empty_full (line 81) | fn len_empty_full() {
  function try_recv (line 103) | fn try_recv() {
  function recv (line 121) | fn recv() {
  function recv_timeout (line 139) | fn recv_timeout() {
  function recv_two (line 163) | fn recv_two() {
  function recv_race (line 190) | fn recv_race() {
  function stress_default (line 203) | fn stress_default() {
  function select (line 223) | fn select() {
  function ready (line 267) | fn ready() {
  function fairness (line 315) | fn fairness() {
  function fairness_duplicates (line 338) | fn fairness_duplicates() {

FILE: crossbeam-channel/tests/zero.rs
  function ms (line 16) | fn ms(ms: u64) -> Duration {
  function smoke (line 21) | fn smoke() {
  function capacity (line 28) | fn capacity() {
  function len_empty_full (line 35) | fn len_empty_full() {
  function try_recv (line 60) | fn try_recv() {
  function recv (line 80) | fn recv() {
  function recv_timeout (line 103) | fn recv_timeout() {
  function try_send (line 124) | fn try_send() {
  function send (line 144) | fn send() {
  function send_timeout (line 166) | fn send_timeout() {
  function len (line 190) | fn len() {
  function disconnect_wakes_sender (line 220) | fn disconnect_wakes_sender() {
  function disconnect_wakes_receiver (line 236) | fn disconnect_wakes_receiver() {
  function spsc (line 252) | fn spsc() {
  function mpmc (line 274) | fn mpmc() {
  function stress_oneshot (line 306) | fn stress_oneshot() {
  function stress_iter (line 321) | fn stress_iter() {
  function stress_timeout_two_threads (line 351) | fn stress_timeout_two_threads() {
  function drops (line 388) | fn drops() {
  function fairness (line 434) | fn fairness() {
  function fairness_duplicates (line 465) | fn fairness_duplicates() {
  function recv_in_send (line 501) | fn recv_in_send() {
  function channel_through_channel (line 523) | fn channel_through_channel() {

FILE: crossbeam-deque/build.rs
  function main (line 5) | fn main() {

FILE: crossbeam-deque/src/deque.rs
  constant MIN_CAP (line 18) | const MIN_CAP: usize = 64;
  constant MAX_BATCH (line 20) | const MAX_BATCH: usize = 32;
  constant FLUSH_THRESHOLD_BYTES (line 23) | const FLUSH_THRESHOLD_BYTES: usize = 1 << 10;
  type Buffer (line 29) | struct Buffer<T> {
  function alloc (line 41) | fn alloc(cap: usize) -> Self {
  function dealloc (line 55) | unsafe fn dealloc(self) {
  function at (line 65) | unsafe fn at(&self, index: isize) -> *mut T {
  function write (line 78) | unsafe fn write(&self, index: isize, task: MaybeUninit<T>) {
  function read (line 88) | unsafe fn read(&self, index: isize) -> MaybeUninit<T> {
  method clone (line 94) | fn clone(&self) -> Self {
  type Inner (line 114) | struct Inner<T> {
  method drop (line 126) | fn drop(&mut self) {
  type Flavor (line 149) | enum Flavor {
  type Worker (line 197) | pub struct Worker<T> {
  function new_fifo (line 225) | pub fn new_fifo() -> Self {
  function new_lifo (line 253) | pub fn new_lifo() -> Self {
  function stealer (line 282) | pub fn stealer(&self) -> Stealer<T> {
  function resize (line 291) | unsafe fn resize(&self, new_cap: usize) {
  function reserve (line 326) | fn reserve(&self, reserve_cap: usize) {
  function is_empty (line 363) | pub fn is_empty(&self) -> bool {
  function len (line 382) | pub fn len(&self) -> usize {
  function push (line 399) | pub fn push(&self, task: T) {
  function pop (line 450) | pub fn pop(&self) -> Option<T> {
  function fmt (line 549) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  type Stealer (line 574) | pub struct Stealer<T> {
  function is_empty (line 598) | pub fn is_empty(&self) -> bool {
  function len (line 619) | pub fn len(&self) -> usize {
  function steal (line 641) | pub fn steal(&self) -> Steal<T> {
  function steal_batch (line 708) | pub fn steal_batch(&self, dest: &Worker<T>) -> Steal<()> {
  function steal_batch_with_limit (line 746) | pub fn steal_batch_with_limit(&self, dest: &Worker<T>, limit: usize) -> ...
  function steal_batch_and_pop (line 949) | pub fn steal_batch_and_pop(&self, dest: &Worker<T>) -> Steal<T> {
  function steal_batch_with_limit_and_pop (line 989) | pub fn steal_batch_with_limit_and_pop(&self, dest: &Worker<T>, limit: us...
  method clone (line 1182) | fn clone(&self) -> Self {
  function fmt (line 1191) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  constant WRITE (line 1200) | const WRITE: usize = 1;
  constant READ (line 1201) | const READ: usize = 2;
  constant DESTROY (line 1202) | const DESTROY: usize = 4;
  constant LAP (line 1205) | const LAP: usize = 64;
  constant BLOCK_CAP (line 1207) | const BLOCK_CAP: usize = LAP - 1;
  constant SHIFT (line 1209) | const SHIFT: usize = 1;
  constant HAS_NEXT (line 1211) | const HAS_NEXT: usize = 1;
  type Slot (line 1214) | struct Slot<T> {
  function wait_write (line 1224) | fn wait_write(&self) {
  type Block (line 1235) | struct Block<T> {
  constant LAYOUT (line 1244) | const LAYOUT: Layout = {
  function new (line 1254) | fn new() -> Box<Self> {
  function wait_next (line 1272) | fn wait_next(&self) -> *mut Self {
  function destroy (line 1284) | unsafe fn destroy(this: *mut Self, count: usize) {
  type Position (line 1305) | struct Position<T> {
  type Injector (line 1332) | pub struct Injector<T> {
  method default (line 1347) | fn default() -> Self {
  function new (line 1373) | pub fn new() -> Self {
  function push (line 1388) | pub fn push(&self, task: T) {
  function steal (line 1464) | pub fn steal(&self) -> Steal<T> {
  function steal_batch (line 1564) | pub fn steal_batch(&self, dest: &Worker<T>) -> Steal<()> {
  function steal_batch_with_limit (line 1601) | pub fn steal_batch_with_limit(&self, dest: &Worker<T>, limit: usize) -> ...
  function steal_batch_and_pop (line 1766) | pub fn steal_batch_and_pop(&self, dest: &Worker<T>) -> Steal<T> {
  function steal_batch_with_limit_and_pop (line 1805) | pub fn steal_batch_with_limit_and_pop(&self, dest: &Worker<T>, limit: us...
  function is_empty (line 1967) | pub fn is_empty(&self) -> bool {
  function len (line 1988) | pub fn len(&self) -> usize {
  method drop (line 2025) | fn drop(&mut self) {
  function fmt (line 2060) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  type Steal (line 2085) | pub enum Steal<T> {
  function is_empty (line 2109) | pub fn is_empty(&self) -> bool {
  function is_success (line 2125) | pub fn is_success(&self) -> bool {
  function is_retry (line 2141) | pub fn is_retry(&self) -> bool {
  function success (line 2157) | pub fn success(self) -> Option<T> {
  function or_else (line 2185) | pub fn or_else<F>(self, f: F) -> Self
  function fmt (line 2204) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  function from_iter (line 2218) | fn from_iter<I>(iter: I) -> Self

FILE: crossbeam-deque/tests/fifo.rs
  function smoke (line 13) | fn smoke() {
  function is_empty (line 49) | fn is_empty() {
  function spsc (line 75) | fn spsc() {
  function stampede (line 103) | fn stampede() {
  function stress (line 144) | fn stress() {
  function no_starvation (line 204) | fn no_starvation() {
  function destructors (line 263) | fn destructors() {

FILE: crossbeam-deque/tests/injector.rs
  function busy_retry (line 13) | fn busy_retry<T>(mut f: impl FnMut() -> Steal<T>) -> Steal<T> {
  function smoke (line 23) | fn smoke() {
  function is_empty (line 39) | fn is_empty() {
  function spsc (line 60) | fn spsc() {
  function mpmc (line 89) | fn mpmc() {
  function stampede (line 128) | fn stampede() {
  function stress (line 169) | fn stress() {
  function no_starvation (line 233) | fn no_starvation() {
  function destructors (line 292) | fn destructors() {
  function stack_overflow (line 375) | fn stack_overflow() {

FILE: crossbeam-deque/tests/lifo.rs
  function smoke (line 13) | fn smoke() {
  function is_empty (line 49) | fn is_empty() {
  function spsc (line 75) | fn spsc() {
  function stampede (line 105) | fn stampede() {
  function stress (line 146) | fn stress() {
  function no_starvation (line 206) | fn no_starvation() {
  function destructors (line 265) | fn destructors() {

FILE: crossbeam-deque/tests/steal.rs
  function busy_retry (line 7) | fn busy_retry<T>(mut f: impl FnMut() -> Steal<T>) -> Steal<T> {
  function steal_fifo (line 17) | fn steal_fifo() {
  function steal_lifo (line 30) | fn steal_lifo() {
  function steal_injector (line 43) | fn steal_injector() {
  function steal_batch_fifo_fifo (line 55) | fn steal_batch_fifo_fifo() {
  function steal_batch_lifo_lifo (line 70) | fn steal_batch_lifo_lifo() {
  function steal_batch_fifo_lifo (line 85) | fn steal_batch_fifo_lifo() {
  function steal_batch_lifo_fifo (line 100) | fn steal_batch_lifo_fifo() {
  function steal_batch_injector_fifo (line 115) | fn steal_batch_injector_fifo() {
  function steal_batch_injector_lifo (line 128) | fn steal_batch_injector_lifo() {
  function steal_batch_and_pop_fifo_fifo (line 141) | fn steal_batch_and_pop_fifo_fifo() {
  function steal_batch_and_pop_lifo_lifo (line 156) | fn steal_batch_and_pop_lifo_lifo() {
  function steal_batch_and_pop_fifo_lifo (line 171) | fn steal_batch_and_pop_fifo_lifo() {
  function steal_batch_and_pop_lifo_fifo (line 186) | fn steal_batch_and_pop_lifo_fifo() {
  function steal_batch_and_pop_injector_fifo (line 201) | fn steal_batch_and_pop_injector_fifo() {
  function steal_batch_and_pop_injector_lifo (line 214) | fn steal_batch_and_pop_injector_lifo() {

FILE: crossbeam-epoch/benches/defer.rs
  function single_alloc_defer_free (line 10) | fn single_alloc_defer_free(b: &mut Bencher) {
  function single_defer (line 21) | fn single_defer(b: &mut Bencher) {
  function multi_alloc_defer_free (line 29) | fn multi_alloc_defer_free(b: &mut Bencher) {
  function multi_defer (line 52) | fn multi_defer(b: &mut Bencher) {

FILE: crossbeam-epoch/benches/flush.rs
  function single_flush (line 12) | fn single_flush(b: &mut Bencher) {
  function multi_flush (line 35) | fn multi_flush(b: &mut Bencher) {

FILE: crossbeam-epoch/benches/pin.rs
  function single_pin (line 10) | fn single_pin(b: &mut Bencher) {
  function multi_pin (line 15) | fn multi_pin(b: &mut Bencher) {

FILE: crossbeam-epoch/build.rs
  function main (line 5) | fn main() {

FILE: crossbeam-epoch/examples/sanitize.rs
  function worker (line 15) | fn worker(a: Arc<Atomic<AtomicUsize>>, handle: LocalHandle) -> usize {
  function main (line 49) | fn main() {

FILE: crossbeam-epoch/src/atomic.rs
  type CompareExchangeValue (line 23) | pub struct CompareExchangeValue<'g, T: ?Sized + Pointable> {
  function fmt (line 32) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  type CompareExchangeError (line 41) | pub struct CompareExchangeError<'g, T: ?Sized + Pointable, P: Pointer<T>> {
  function fmt (line 50) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  function low_bits (line 60) | fn low_bits<T: ?Sized + Pointable>() -> usize {
  function ensure_aligned (line 66) | fn ensure_aligned<T: ?Sized + Pointable>(raw: *mut ()) {
  function compose_tag (line 74) | fn compose_tag<T: ?Sized + Pointable>(ptr: *mut (), tag: usize) -> *mut ...
  function decompose_tag (line 80) | fn decompose_tag<T: ?Sized + Pointable>(ptr: *mut ()) -> (*mut (), usize) {
  function map_addr (line 90) | fn map_addr<T>(ptr: *mut T, f: impl FnOnce(usize) -> usize) -> *mut T {
  type Pointable (line 117) | pub trait Pointable {
    constant ALIGN (line 119) | const ALIGN: usize;
    method init (line 129) | unsafe fn init(init: Self::Init) -> *mut ();
    method as_ptr (line 138) | unsafe fn as_ptr(ptr: *mut ()) -> *const Self;
    method as_mut_ptr (line 148) | unsafe fn as_mut_ptr(ptr: *mut ()) -> *mut Self;
    method drop (line 158) | unsafe fn drop(ptr: *mut ());
    constant ALIGN (line 162) | const ALIGN: usize = mem::align_of::<T>();
    type Init (line 164) | type Init = T;
    method init (line 166) | unsafe fn init(init: Self::Init) -> *mut () {
    method as_ptr (line 170) | unsafe fn as_ptr(ptr: *mut ()) -> *const Self {
    method as_mut_ptr (line 174) | unsafe fn as_mut_ptr(ptr: *mut ()) -> *mut Self {
    method drop (line 178) | unsafe fn drop(ptr: *mut ()) {
    constant ALIGN (line 220) | const ALIGN: usize = mem::align_of::<Array<T>>();
    type Init (line 222) | type Init = usize;
    method init (line 225) | unsafe fn init(len: Self::Init) -> *mut () {
    method as_ptr (line 237) | unsafe fn as_ptr(ptr: *mut ()) -> *const Self {
    method as_mut_ptr (line 247) | unsafe fn as_mut_ptr(ptr: *mut ()) -> *mut Self {
    method drop (line 256) | unsafe fn drop(ptr: *mut ()) {
  type Array (line 203) | struct Array<T> {
  function layout (line 210) | fn layout(len: usize) -> Layout {
  type Atomic (line 274) | pub struct Atomic<T: ?Sized + Pointable> {
  function new (line 293) | pub fn new(init: T) -> Self {
  function init (line 309) | pub fn init(init: T::Init) -> Self {
  function from_ptr (line 314) | fn from_ptr(data: *mut ()) -> Self {
  function load (line 356) | pub fn load<'g>(&self, order: Ordering, _: &'g Guard) -> Shared<'g, T> {
  function load_consume (line 382) | pub fn load_consume<'g>(&self, _: &'g Guard) -> Shared<'g, T> {
  function store (line 403) | pub fn store<P: Pointer<T>>(&self, new: P, order: Ordering) {
  function swap (line 424) | pub fn swap<'g, P: Pointer<T>>(&self, new: P, order: Ordering, _: &'g Gu...
  function compare_exchange (line 460) | pub fn compare_exchange<'g, P>(
  function compare_exchange_weak (line 544) | pub fn compare_exchange_weak<'g, P>(
  function fetch_update (line 612) | pub fn fetch_update<'g, F>(
  function fetch_and (line 651) | pub fn fetch_and<'g>(&self, val: usize, order: Ordering, _: &'g Guard) -...
  function fetch_or (line 689) | pub fn fetch_or<'g>(&self, val: usize, order: Ordering, _: &'g Guard) ->...
  function fetch_xor (line 727) | pub fn fetch_xor<'g>(&self, val: usize, order: Ordering, _: &'g Guard) -...
  function into_owned (line 780) | pub unsafe fn into_owned(self) -> Owned<T> {
  function try_into_owned (line 817) | pub unsafe fn try_into_owned(self) -> Option<Owned<T>> {
  function fmt (line 828) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  function fmt (line 840) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  method clone (line 852) | fn clone(&self) -> Self {
  method default (line 859) | fn default() -> Self {
  function from (line 875) | fn from(owned: Owned<T>) -> Self {
  function from (line 883) | fn from(b: Box<T>) -> Self {
  function from (line 889) | fn from(t: T) -> Self {
  function from (line 904) | fn from(ptr: Shared<'g, T>) -> Self {
  function from (line 920) | fn from(raw: *const T) -> Self {
  type Pointer (line 928) | pub trait Pointer<T: ?Sized + Pointable>: crate::sealed::Sealed {
    method into_ptr (line 930) | fn into_ptr(self) -> *mut ();
    method from_ptr (line 938) | unsafe fn from_ptr(data: *mut ()) -> Self;
  type Owned (line 947) | pub struct Owned<T: ?Sized + Pointable> {
  function into_ptr (line 955) | fn into_ptr(self) -> *mut () {
  function from_ptr (line 967) | unsafe fn from_ptr(data: *mut ()) -> Self {
  function from_raw (line 999) | pub unsafe fn from_raw(raw: *mut T) -> Self {
  function into_box (line 1016) | pub fn into_box(self) -> Box<T> {
  function new (line 1031) | pub fn new(init: T) -> Self {
  function init (line 1046) | pub fn init(init: T::Init) -> Self {
  function into_shared (line 1063) | pub fn into_shared<'g>(self, _: &'g Guard) -> Shared<'g, T> {
  function tag (line 1076) | pub fn tag(&self) -> usize {
  function with_tag (line 1094) | pub fn with_tag(self, tag: usize) -> Self {
  method drop (line 1101) | fn drop(&mut self) {
  function fmt (line 1110) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  method clone (line 1121) | fn clone(&self) -> Self {
  type Target (line 1127) | type Target = T;
  method deref (line 1129) | fn deref(&self) -> &T {
  method deref_mut (line 1136) | fn deref_mut(&mut self) -> &mut T {
  function from (line 1143) | fn from(t: T) -> Self {
  function from (line 1162) | fn from(b: Box<T>) -> Self {
  function borrow (line 1168) | fn borrow(&self) -> &T {
  function borrow_mut (line 1174) | fn borrow_mut(&mut self) -> &mut T {
  function as_ref (line 1180) | fn as_ref(&self) -> &T {
  function as_mut (line 1186) | fn as_mut(&mut self) -> &mut T {
  type Shared (line 1197) | pub struct Shared<'g, T: 'g + ?Sized + Pointable> {
  method clone (line 1203) | fn clone(&self) -> Self {
  function into_ptr (line 1213) | fn into_ptr(self) -> *mut () {
  function from_ptr (line 1218) | unsafe fn from_ptr(data: *mut ()) -> Self {
  function as_raw (line 1244) | pub fn as_raw(&self) -> *const T {
  function null (line 1261) | pub const fn null() -> Self {
  function is_null (line 1283) | pub fn is_null(&self) -> bool {
  function as_ptr (line 1288) | pub(crate) unsafe fn as_ptr(&self) -> *const T {
  function as_mut_ptr (line 1293) | pub(crate) unsafe fn as_mut_ptr(&self) -> *mut T {
  function deref (line 1330) | pub unsafe fn deref(&self) -> &'g T {
  function deref_mut (line 1371) | pub unsafe fn deref_mut(&mut self) -> &'g mut T {
  function as_ref (line 1407) | pub unsafe fn as_ref(&self) -> Option<&'g T> {
  function into_owned (line 1440) | pub unsafe fn into_owned(self) -> Owned<T> {
  function try_into_owned (line 1467) | pub unsafe fn try_into_owned(self) -> Option<Owned<T>> {
  function tag (line 1489) | pub fn tag(&self) -> usize {
  function with_tag (line 1513) | pub fn with_tag(&self, tag: usize) -> Self {
  function from (line 1534) | fn from(raw: *const T) -> Self {
  method eq (line 1542) | fn eq(&self, other: &Self) -> bool {
  method partial_cmp (line 1550) | fn partial_cmp(&self, other: &Self) -> Option<cmp::Ordering> {
  method cmp (line 1556) | fn cmp(&self, other: &Self) -> cmp::Ordering {
  function fmt (line 1562) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  function fmt (line 1573) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  method default (line 1579) | fn default() -> Self {
  function valid_tag_i8 (line 1597) | fn valid_tag_i8() {
  function valid_tag_i64 (line 1602) | fn valid_tag_i64() {
  function const_null (line 1607) | fn const_null() {
  function array_init (line 1616) | fn array_init() {
  function compare_exchange_success (line 1623) | fn compare_exchange_success() {
  function compare_exchange_failure (line 1655) | fn compare_exchange_failure() {
  function compare_exchange_weak_success (line 1693) | fn compare_exchange_weak_success() {

FILE: crossbeam-epoch/src/collector.rs
  type Collector (line 24) | pub struct Collector {
    method new (line 42) | pub fn new() -> Self {
    method register (line 47) | pub fn register(&self) -> LocalHandle {
    method fmt (line 62) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  method default (line 33) | fn default() -> Self {
  method clone (line 54) | fn clone(&self) -> Self {
  method eq (line 69) | fn eq(&self, rhs: &Self) -> bool {
  type LocalHandle (line 76) | pub struct LocalHandle {
    method pin (line 83) | pub fn pin(&self) -> Guard {
    method is_pinned (line 89) | pub fn is_pinned(&self) -> bool {
    method collector (line 95) | pub fn collector(&self) -> &Collector {
    method fmt (line 110) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  method drop (line 102) | fn drop(&mut self) {
  constant NUM_THREADS (line 132) | const NUM_THREADS: usize = 8;
  function pin_reentrant (line 135) | fn pin_reentrant() {
  function flush_local_bag (line 154) | fn flush_local_bag() {
  function garbage_buffering (line 175) | fn garbage_buffering() {
  function pin_holds_advance (line 191) | fn pin_holds_advance() {
  function incremental (line 218) | fn incremental() {
  function buffering (line 251) | fn buffering() {
  function count_drops (line 285) | fn count_drops() {
  function count_destroy (line 318) | fn count_destroy() {
  function drop_array (line 346) | fn drop_array() {
  function destroy_array (line 384) | fn destroy_array() {
  function stress (line 417) | fn stress() {

FILE: crossbeam-epoch/src/default.rs
  function collector (line 16) | fn collector() -> &'static Collector {
  function pin (line 42) | pub fn pin() -> Guard {
  function is_pinned (line 48) | pub fn is_pinned() -> bool {
  function default_collector (line 53) | pub fn default_collector() -> &'static Collector {
  function with_handle (line 58) | fn with_handle<F, R>(mut f: F) -> R
  function pin_while_exiting (line 77) | fn pin_while_exiting() {

FILE: crossbeam-epoch/src/deferred.rs
  constant DATA_WORDS (line 13) | const DATA_WORDS: usize = 3;
  type Data (line 16) | type Data = [usize; DATA_WORDS];
  type Deferred (line 21) | pub(crate) struct Deferred {
    method fmt (line 28) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
    constant NO_OP (line 34) | pub(crate) const NO_OP: Self = {
    method new (line 44) | pub(crate) fn new<F: FnOnce()>(f: F) -> Self {
    method call (line 86) | pub(crate) fn call(mut self) {
  function on_stack (line 104) | fn on_stack() {
  function on_heap (line 119) | fn on_heap() {
  function string (line 134) | fn string() {
  function boxed_slice_i32 (line 141) | fn boxed_slice_i32() {
  function long_slice_usize (line 148) | fn long_slice_usize() {

FILE: crossbeam-epoch/src/epoch.rs
  type AtomicEpochRepr (line 16) | type AtomicEpochRepr = crate::primitive::sync::atomic::AtomicU64;
  type AtomicEpochRepr (line 18) | type AtomicEpochRepr = crate::primitive::sync::atomic::AtomicUsize;
  type EpochRepr (line 20) | type EpochRepr = u64;
  type EpochRepr (line 22) | type EpochRepr = usize;
  type EpochReprSigned (line 24) | type EpochReprSigned = i64;
  type EpochReprSigned (line 26) | type EpochReprSigned = isize;
  type Epoch (line 33) | pub(crate) struct Epoch {
    method starting (line 41) | pub(crate) fn starting() -> Self {
    method wrapping_sub (line 49) | pub(crate) fn wrapping_sub(self, rhs: Self) -> EpochReprSigned {
    method is_pinned (line 58) | pub(crate) fn is_pinned(self) -> bool {
    method pinned (line 64) | pub(crate) fn pinned(self) -> Self {
    method unpinned (line 72) | pub(crate) fn unpinned(self) -> Self {
    method successor (line 82) | pub(crate) fn successor(self) -> Self {
  type AtomicEpoch (line 91) | pub(crate) struct AtomicEpoch {
    method new (line 100) | pub(crate) fn new(epoch: Epoch) -> Self {
    method load (line 107) | pub(crate) fn load(&self, ord: Ordering) -> Epoch {
    method store (line 115) | pub(crate) fn store(&self, epoch: Epoch, ord: Ordering) {
    method compare_exchange (line 133) | pub(crate) fn compare_exchange(

FILE: crossbeam-epoch/src/guard.rs
  type Guard (line 70) | pub struct Guard {
    method defer (line 90) | pub fn defer<F, R>(&self, f: F)
    method defer_unchecked (line 189) | pub unsafe fn defer_unchecked<F, R>(&self, f: F)
    method defer_destroy (line 271) | pub unsafe fn defer_destroy<T: ?Sized + Pointable>(&self, ptr: Shared<...
    method flush (line 295) | pub fn flush(&self) {
    method repin (line 329) | pub fn repin(&mut self) {
    method repin_after (line 366) | pub fn repin_after<F, R>(&mut self, f: F) -> R
    method collector (line 411) | pub fn collector(&self) -> Option<&Collector> {
    method fmt (line 426) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  method drop (line 418) | fn drop(&mut self) {
  function unprotected (line 518) | pub unsafe fn unprotected() -> &'static Guard {

FILE: crossbeam-epoch/src/internal.rs
  constant MAX_OBJECTS (line 66) | const MAX_OBJECTS: usize = 64;
  constant MAX_OBJECTS (line 69) | const MAX_OBJECTS: usize = 4;
  type Bag (line 72) | pub(crate) struct Bag {
    method new (line 83) | pub(crate) fn new() -> Self {
    method is_empty (line 88) | pub(crate) fn is_empty(&self) -> bool {
    method try_push (line 100) | pub(crate) unsafe fn try_push(&mut self, deferred: Deferred) -> Result...
    method seal (line 111) | fn seal(self, epoch: Epoch) -> SealedBag {
    method fmt (line 138) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  method default (line 117) | fn default() -> Self {
  method drop (line 126) | fn drop(&mut self) {
  type SealedBag (line 147) | struct SealedBag {
    method is_expired (line 157) | fn is_expired(&self, global_epoch: Epoch) -> bool {
  type Global (line 165) | pub(crate) struct Global {
    constant COLLECT_STEPS (line 178) | const COLLECT_STEPS: usize = 8;
    method new (line 182) | pub(crate) fn new() -> Self {
    method push_bag (line 191) | pub(crate) fn push_bag(&self, bag: &mut Bag, guard: &Guard) {
    method collect (line 208) | pub(crate) fn collect(&self, guard: &Guard) {
    method try_advance (line 237) | pub(crate) fn try_advance(&self, guard: &Guard) -> Epoch {
  type Local (line 293) | pub(crate) struct Local {
    constant PINNINGS_BETWEEN_COLLECT (line 335) | const PINNINGS_BETWEEN_COLLECT: usize = 128;
    method register (line 338) | pub(crate) fn register(collector: &Collector) -> LocalHandle {
    method global (line 361) | pub(crate) fn global(&self) -> &Global {
    method collector (line 367) | pub(crate) fn collector(&self) -> &Collector {
    method is_pinned (line 373) | pub(crate) fn is_pinned(&self) -> bool {
    method defer (line 382) | pub(crate) unsafe fn defer(&self, mut deferred: Deferred, guard: &Guar...
    method flush (line 391) | pub(crate) fn flush(&self, guard: &Guard) {
    method pin (line 403) | pub(crate) fn pin(&self) -> Guard {
    method unpin (line 466) | pub(crate) fn unpin(&self) {
    method repin (line 483) | pub(crate) fn repin(&self) {
    method acquire_handle (line 506) | pub(crate) fn acquire_handle(&self) {
    method release_handle (line 514) | pub(crate) unsafe fn release_handle(this: *const Self) {
    method finalize (line 531) | unsafe fn finalize(this: *const Self) {
    method entry_of (line 573) | fn entry_of(local: *const Self) -> *const Entry {
    method element_of (line 578) | unsafe fn element_of(entry: *const Entry) -> *const Self {
    method finalize (line 583) | unsafe fn finalize(entry: *const Entry, guard: &Guard) {
  function local_size (line 324) | fn local_size() {
  function check_defer (line 600) | fn check_defer() {
  function check_bag (line 613) | fn check_bag() {

FILE: crossbeam-epoch/src/lib.rs
  type UnsafeCell (line 99) | pub(crate) struct UnsafeCell<T>(::core::cell::UnsafeCell<T>);
  function new (line 108) | pub(crate) const fn new(data: T) -> Self {
  function with (line 113) | pub(crate) fn with<R>(&self, f: impl FnOnce(*const T) -> R) -> R {
  function with_mut (line 118) | pub(crate) fn with_mut<R>(&self, f: impl FnOnce(*mut T) -> R) -> R {
  type Sealed (line 181) | pub trait Sealed {}

FILE: crossbeam-epoch/src/sync/list.rs
  type Entry (line 19) | pub(crate) struct Entry {
    method delete (line 151) | pub(crate) unsafe fn delete(&self, guard: &Guard) {
    method entry_of (line 316) | fn entry_of(entry: *const Self) -> *const Entry {
    method element_of (line 320) | unsafe fn element_of(entry: *const Entry) -> *const Self {
    method finalize (line 324) | unsafe fn finalize(entry: *const Entry, guard: &Guard) {
  type IsElement (line 70) | pub(crate) trait IsElement<T> {
    method entry_of (line 72) | fn entry_of(_: *const T) -> *const Entry;
    method element_of (line 86) | unsafe fn element_of(_: *const Entry) -> *const T;
    method finalize (line 94) | unsafe fn finalize(_: *const Entry, _: &Guard);
  type List (line 99) | pub(crate) struct List<T, C: IsElement<T> = T> {
  type Iter (line 108) | pub(crate) struct Iter<'g, T, C: IsElement<T>> {
  type IterError (line 128) | pub(crate) enum IterError {
  method default (line 136) | fn default() -> Self {
  function new (line 158) | pub(crate) fn new() -> Self {
  function insert (line 175) | pub(crate) unsafe fn insert<'g>(&'g self, container: Shared<'g, T>, guar...
  function iter (line 210) | pub(crate) fn iter<'g>(&'g self, guard: &'g Guard) -> Iter<'g, T, C> {
  method drop (line 222) | fn drop(&mut self) {
  type Item (line 239) | type Item = Result<&'g T, IterError>;
  method next (line 241) | fn next(&mut self) -> Option<Self::Item> {
  function insert (line 332) | fn insert() {
  function delete (line 371) | fn delete() {
  constant THREADS (line 406) | const THREADS: usize = 8;
  constant ITERS (line 407) | const ITERS: usize = 512;
  function insert_delete_multi (line 411) | fn insert_delete_multi() {
  function iter_multi (line 453) | fn iter_multi() {

FILE: crossbeam-epoch/src/sync/queue.rs
  type Queue (line 24) | pub(crate) struct Queue<T> {
  type Node (line 29) | struct Node<T> {
  function new (line 47) | pub(crate) fn new() -> Self {
  function push_internal (line 68) | fn push_internal(
  function push (line 100) | pub(crate) fn push(&self, t: T, guard: &Guard) {
  function pop_internal (line 120) | fn pop_internal(&self, guard: &Guard) -> Result<Option<T>, ()> {
  function pop_if_internal (line 148) | fn pop_if_internal<F>(&self, condition: F, guard: &Guard) -> Result<Opti...
  function try_pop (line 180) | pub(crate) fn try_pop(&self, guard: &Guard) -> Option<T> {
  function try_pop_if (line 192) | pub(crate) fn try_pop_if<F>(&self, condition: F, guard: &Guard) -> Optio...
  method drop (line 206) | fn drop(&mut self) {
  type Queue (line 233) | struct Queue<T> {
  function new (line 238) | pub(crate) fn new() -> Self {
  function push (line 244) | pub(crate) fn push(&self, t: T) {
  function is_empty (line 249) | pub(crate) fn is_empty(&self) -> bool {
  function try_pop (line 256) | pub(crate) fn try_pop(&self) -> Option<T> {
  function pop (line 261) | pub(crate) fn pop(&self) -> T {
  constant CONC_COUNT (line 271) | const CONC_COUNT: i64 = if cfg!(miri) { 1000 } else { 1000000 };
  function push_try_pop_1 (line 274) | fn push_try_pop_1() {
  function push_try_pop_2 (line 284) | fn push_try_pop_2() {
  function push_try_pop_many_seq (line 296) | fn push_try_pop_many_seq() {
  function push_pop_1 (line 310) | fn push_pop_1() {
  function push_pop_2 (line 320) | fn push_pop_2() {
  function push_pop_many_seq (line 329) | fn push_pop_many_seq() {
  function push_try_pop_many_spsc (line 343) | fn push_try_pop_many_spsc() {
  function push_try_pop_many_spmc (line 367) | fn push_try_pop_many_spmc() {
  function push_try_pop_many_mpmc (line 400) | fn push_try_pop_many_mpmc() {
  function push_pop_many_spsc (line 446) | fn push_pop_many_spsc() {
  function is_empty_dont_pop (line 467) | fn is_empty_dont_pop() {

FILE: crossbeam-epoch/tests/loom.rs
  function it_works (line 18) | fn it_works() {
  function treiber_stack (line 52) | fn treiber_stack() {

FILE: crossbeam-queue/src/array_queue.rs
  type Slot (line 18) | struct Slot<T> {
  type ArrayQueue (line 52) | pub struct ArrayQueue<T> {
  function new (line 96) | pub fn new(cap: usize) -> Self {
  function push_or_else (line 127) | fn push_or_else<F>(&self, mut value: T, f: F) -> Result<(), T>
  function push (line 203) | pub fn push(&self, value: T) -> Result<(), T> {
  function push_mut (line 231) | pub fn push_mut(&mut self, value: T) -> Result<(), T> {
  function force_push (line 275) | pub fn force_push(&self, value: T) -> Option<T> {
  function pop (line 318) | pub fn pop(&self) -> Option<T> {
  function pop_mut (line 397) | pub fn pop_mut(&mut self) -> Option<T> {
  function capacity (line 441) | pub fn capacity(&self) -> usize {
  function is_empty (line 458) | pub fn is_empty(&self) -> bool {
  function is_full (line 483) | pub fn is_full(&self) -> bool {
  function len (line 510) | pub fn len(&self) -> usize {
  method drop (line 536) | fn drop(&mut self) {
  function fmt (line 575) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  type Item (line 581) | type Item = T;
  type IntoIter (line 583) | type IntoIter = IntoIter<T>;
  method into_iter (line 585) | fn into_iter(self) -> Self::IntoIter {
  type IntoIter (line 591) | pub struct IntoIter<T> {
  type Item (line 596) | type Item = T;
  method next (line 598) | fn next(&mut self) -> Option<Self::Item> {

FILE: crossbeam-queue/src/seg_queue.rs
  constant WRITE (line 21) | const WRITE: usize = 1;
  constant READ (line 22) | const READ: usize = 2;
  constant DESTROY (line 23) | const DESTROY: usize = 4;
  constant LAP (line 26) | const LAP: usize = 32;
  constant BLOCK_CAP (line 28) | const BLOCK_CAP: usize = LAP - 1;
  constant SHIFT (line 30) | const SHIFT: usize = 1;
  constant HAS_NEXT (line 32) | const HAS_NEXT: usize = 1;
  type Slot (line 35) | struct Slot<T> {
  function wait_write (line 45) | fn wait_write(&self) {
  type Block (line 56) | struct Block<T> {
  constant LAYOUT (line 65) | const LAYOUT: Layout = {
  function new (line 75) | fn new() -> Box<Self> {
  function wait_next (line 93) | fn wait_next(&self) -> *mut Self {
  function destroy (line 105) | unsafe fn destroy(this: *mut Self, start: usize) {
  function destroy_mut (line 124) | unsafe fn destroy_mut(this: *mut Self) {
  type Position (line 130) | struct Position<T> {
  type SegQueue (line 161) | pub struct SegQueue<T> {
  function new (line 188) | pub const fn new() -> Self {
  function push (line 214) | pub fn push(&self, value: T) {
  function push_mut (line 309) | pub fn push_mut(&mut self, value: T) {
  function pop (line 364) | pub fn pop(&self) -> Option<T> {
  function pop_mut (line 471) | pub fn pop_mut(&mut self) -> Option<T> {
  function is_empty (line 541) | pub fn is_empty(&self) -> bool {
  function len (line 563) | pub fn len(&self) -> usize {
  method drop (line 600) | fn drop(&mut self) {
  function fmt (line 637) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  method default (line 643) | fn default() -> Self {
  type Item (line 649) | type Item = T;
  type IntoIter (line 651) | type IntoIter = IntoIter<T>;
  method into_iter (line 653) | fn into_iter(self) -> Self::IntoIter {
  type IntoIter (line 659) | pub struct IntoIter<T> {
  type Item (line 664) | type Item = T;
  method next (line 666) | fn next(&mut self) -> Option<Self::Item> {

FILE: crossbeam-queue/tests/array_queue.rs
  function smoke (line 7) | fn smoke() {
  function capacity (line 19) | fn capacity() {
  function zero_capacity (line 28) | fn zero_capacity() {
  function len_empty_full (line 33) | fn len_empty_full() {
  function exclusive_reference (line 60) | fn exclusive_reference() {
  function len (line 90) | fn len() {
  function spsc (line 148) | fn spsc() {
  function spsc_ring_buffer (line 176) | fn spsc_ring_buffer() {
  function mpmc (line 216) | fn mpmc() {
  function mpmc_ring_buffer (line 252) | fn mpmc_ring_buffer() {
  function drops (line 297) | fn drops() {
  function linearizable (line 350) | fn linearizable() {
  function into_iter (line 378) | fn into_iter() {

FILE: crossbeam-queue/tests/seg_queue.rs
  function smoke (line 7) | fn smoke() {
  function len_empty_full (line 18) | fn len_empty_full() {
  function len (line 36) | fn len() {
  function exclusive_reference (line 55) | fn exclusive_reference() {
  function spsc (line 102) | fn spsc() {
  function mpmc (line 129) | fn mpmc() {
  function drops (line 165) | fn drops() {
  function into_iter (line 216) | fn into_iter() {
  function into_iter_drop (line 227) | fn into_iter_drop() {
  function stack_overflow (line 240) | fn stack_overflow() {

FILE: crossbeam-skiplist/benches/btree.rs
  function insert (line 10) | fn insert(b: &mut Bencher) {
  function iter (line 23) | fn iter(b: &mut Bencher) {
  function rev_iter (line 40) | fn rev_iter(b: &mut Bencher) {
  function lookup (line 57) | fn lookup(b: &mut Bencher) {
  function insert_remove (line 77) | fn insert_remove(b: &mut Bencher) {

FILE: crossbeam-skiplist/benches/hash.rs
  function insert (line 10) | fn insert(b: &mut Bencher) {
  function iter (line 23) | fn iter(b: &mut Bencher) {
  function lookup (line 40) | fn lookup(b: &mut Bencher) {
  function insert_remove (line 60) | fn insert_remove(b: &mut Bencher) {

FILE: crossbeam-skiplist/benches/skiplist.rs
  function insert (line 11) | fn insert(b: &mut Bencher) {
  function iter (line 26) | fn iter(b: &mut Bencher) {
  function rev_iter (line 44) | fn rev_iter(b: &mut Bencher) {
  function lookup (line 62) | fn lookup(b: &mut Bencher) {
  function insert_remove (line 82) | fn insert_remove(b: &mut Bencher) {

FILE: crossbeam-skiplist/benches/skipmap.rs
  function insert (line 9) | fn insert(b: &mut Bencher) {
  function iter (line 22) | fn iter(b: &mut Bencher) {
  function rev_iter (line 39) | fn rev_iter(b: &mut Bencher) {
  function lookup (line 56) | fn lookup(b: &mut Bencher) {
  function insert_remove (line 76) | fn insert_remove(b: &mut Bencher) {

FILE: crossbeam-skiplist/examples/simple.rs
  function main (line 3) | fn main() {

FILE: crossbeam-skiplist/src/base.rs
  constant HEIGHT_BITS (line 24) | const HEIGHT_BITS: usize = 5;
  constant MAX_HEIGHT (line 27) | const MAX_HEIGHT: usize = 1 << HEIGHT_BITS;
  constant HEIGHT_MASK (line 30) | const HEIGHT_MASK: usize = (1 << HEIGHT_BITS) - 1;
  type Tower (line 37) | struct Tower<K, V> {
  type TowerRef (line 47) | struct TowerRef<'a, K, V> {
  method clone (line 53) | fn clone(&self) -> Self {
  function new (line 67) | unsafe fn new(ptr: NonNull<Tower<K, V>>) -> Self {
  function get_level (line 80) | unsafe fn get_level(self, index: usize) -> &'a Atomic<Node<K, V>> {
  type Head (line 91) | struct Head<K, V> {
  function new (line 98) | fn new() -> Self {
  function as_tower (line 107) | fn as_tower(&self) -> TowerRef<'_, K, V> {
  function get_level (line 117) | unsafe fn get_level(&self, index: usize) -> &Atomic<Node<K, V>> {
  type Node (line 130) | struct Node<K, V> {
  type NodeRef (line 151) | struct NodeRef<'a, K, V> {
  method clone (line 157) | fn clone(&self) -> Self {
  function alloc (line 169) | unsafe fn alloc(height: usize, ref_count: usize) -> *mut Self {
  function dealloc (line 189) | unsafe fn dealloc(ptr: *mut Self) {
  function get_layout (line 198) | fn get_layout(height: usize) -> Layout {
  function height (line 210) | fn height(&self) -> usize {
  function try_increment (line 222) | unsafe fn try_increment(&self) -> bool {
  function finalize (line 253) | unsafe fn finalize(ptr: *mut Self) {
  function new (line 273) | unsafe fn new(ptr: NonNull<Node<K, V>>) -> Self {
  function from_shared (line 284) | unsafe fn from_shared(shared: Shared<'a, Node<K, V>>) -> Option<Self> {
  function decrement (line 294) | unsafe fn decrement(self, guard: &Guard) {
  function decrement_with_pin (line 309) | unsafe fn decrement_with_pin<F, C>(self, parent: &SkipList<K, V, C>, pin...
  function mark_tower (line 327) | fn mark_tower(self) -> bool {
  function is_removed (line 352) | fn is_removed(self) -> bool {
  function as_tower (line 365) | fn as_tower(self) -> TowerRef<'a, K, V> {
  function as_ref (line 377) | fn as_ref(self) -> &'a Node<K, V> {
  function get_level (line 388) | unsafe fn get_level(&self, index: usize) -> &Atomic<Node<K, V>> {
  type Target (line 395) | type Target = Node<K, V>;
  method deref (line 397) | fn deref(&self) -> &Node<K, V> {
  function fmt (line 407) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  function fmt (line 420) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  type Position (line 429) | struct Position<'a, K, V> {
  type HotData (line 443) | struct HotData {
  type SkipList (line 468) | pub struct SkipList<K, V, C = BasicComparator> {
  function new (line 487) | pub fn new(collector: Collector) -> Self {
  function with_comparator (line 494) | pub fn with_comparator(collector: Collector, comparator: C) -> Self {
  function is_empty (line 508) | pub fn is_empty(&self) -> bool {
  function len (line 516) | pub fn len(&self) -> usize {
  function check_guard (line 526) | fn check_guard(&self, guard: &Guard) {
  function front (line 538) | pub fn front<'a: 'g, 'g>(&'a self, guard: &'g Guard) -> Option<Entry<'a,...
  function back (line 549) | pub fn back<'a: 'g, 'g>(&'a self, guard: &'g Guard) -> Option<Entry<'a, ...
  function contains_key (line 560) | pub fn contains_key<Q>(&self, key: &Q, guard: &Guard) -> bool
  function get (line 569) | pub fn get<'a: 'g, 'g, Q>(&'a self, key: &Q, guard: &'g Guard) -> Option...
  function lower_bound (line 590) | pub fn lower_bound<'a: 'g, 'g, Q>(
  function upper_bound (line 611) | pub fn upper_bound<'a: 'g, 'g, Q>(
  function get_or_insert (line 630) | pub fn get_or_insert(&self, key: K, value: V, guard: &Guard) -> RefEntry...
  function get_or_insert_with (line 641) | pub fn get_or_insert_with<F>(&self, key: K, value: F, guard: &Guard) -> ...
  function iter (line 649) | pub fn iter<'a: 'g, 'g>(&'a self, guard: &'g Guard) -> Iter<'a, 'g, K, V...
  function ref_iter (line 660) | pub fn ref_iter(&self) -> RefIter<'_, K, V, C> {
  function range (line 669) | pub fn range<'a: 'g, 'g, Q, R>(
  function ref_range (line 692) | pub fn ref_range<'a, Q, R>(&'a self, range: R) -> RefRange<'a, Q, R, K, ...
  function random_height (line 708) | fn random_height(&self) -> usize {
  function help_unlink (line 759) | unsafe fn help_unlink<'a>(
  function next_node (line 787) | fn next_node<'a>(
  function search_bound (line 833) | fn search_bound<'a, Q>(
  function search_position (line 923) | fn search_position<'a, Q>(&'a self, key: &Q, guard: &'a Guard) -> Positi...
  function insert_internal (line 1013) | fn insert_internal<F, CompareF>(
  function insert (line 1247) | pub fn insert(&self, key: K, value: V, guard: &Guard) -> RefEntry<'_, K,...
  function compare_insert (line 1256) | pub fn compare_insert<F>(
  function remove (line 1270) | pub fn remove<Q>(&self, key: &Q, guard: &Guard) -> Option<RefEntry<'_, K...
  function pop_front (line 1340) | pub fn pop_front(&self, guard: &Guard) -> Option<RefEntry<'_, K, V, C>> {
  function pop_back (line 1355) | pub fn pop_back(&self, guard: &Guard) -> Option<RefEntry<'_, K, V, C>> {
  function clear (line 1370) | pub fn clear(&self, guard: &mut Guard) {
  method drop (line 1414) | fn drop(&mut self) {
  function fmt (line 1444) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  type Item (line 1450) | type Item = (K, V);
  type IntoIter (line 1451) | type IntoIter = IntoIter<K, V>;
  method into_iter (line 1453) | fn into_iter(self) -> Self::IntoIter {
  type Entry (line 1484) | pub struct Entry<'a: 'g, 'g, K, V, C = BasicComparator> {
  function is_removed (line 1492) | pub fn is_removed(&self) -> bool {
  function key (line 1497) | pub fn key(&self) -> &'g K {
  function value (line 1502) | pub fn value(&self) -> &'g V {
  function skiplist (line 1507) | pub fn skiplist(&self) -> &'a SkipList<K, V, C> {
  function pin (line 1516) | pub fn pin(&self) -> Option<RefEntry<'a, K, V, C>> {
  function remove (line 1530) | pub fn remove(&self) -> bool {
  method clone (line 1548) | fn clone(&self) -> Self {
  function fmt (line 1562) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  function move_next (line 1575) | pub fn move_next(&mut self) -> bool {
  function next (line 1586) | pub fn next(&self) -> Option<Self> {
  function move_prev (line 1600) | pub fn move_prev(&mut self) -> bool {
  function prev (line 1611) | pub fn prev(&self) -> Option<Self> {
  type RefEntry (line 1627) | pub struct RefEntry<'a, K, V, C = BasicComparator> {
  function is_removed (line 1634) | pub fn is_removed(&self) -> bool {
  function key (line 1639) | pub fn key(&self) -> &'a K {
  function value (line 1644) | pub fn value(&self) -> &'a V {
  function skiplist (line 1649) | pub fn skiplist(&self) -> &'a SkipList<K, V, C> {
  function release (line 1654) | pub fn release(self, guard: &Guard) {
  function release_with_pin (line 1661) | pub fn release_with_pin<F>(self, pin: F)
  function try_acquire (line 1670) | unsafe fn try_acquire(parent: &'a SkipList<K, V, C>, node: NodeRef<'_, K...
  function remove (line 1694) | pub fn remove(&self, guard: &Guard) -> bool {
  method clone (line 1714) | fn clone(&self) -> Self {
  function fmt (line 1731) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  function move_next (line 1744) | pub fn move_next(&mut self, guard: &Guard) -> bool {
  function next (line 1755) | pub fn next(&self, guard: &Guard) -> Option<Self> {
  function move_prev (line 1771) | pub fn move_prev(&mut self, guard: &Guard) -> bool {
  function prev (line 1782) | pub fn prev(&self, guard: &Guard) -> Option<Self> {
  type Iter (line 1799) | pub struct Iter<'a: 'g, 'g, K, V, C = BasicComparator> {
  type Item (line 1810) | type Item = Entry<'a, 'g, K, V, C>;
  method next (line 1812) | fn next(&mut self) -> Option<Self::Item> {
  method next_back (line 1840) | fn next_back(&mut self) -> Option<Self::Item> {
  function fmt (line 1868) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  type RefIter (line 1877) | pub struct RefIter<'a, K, V, C = BasicComparator> {
  function fmt (line 1888) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  function next (line 1907) | pub fn next(&mut self, guard: &Guard) -> Option<RefEntry<'a, K, V, C>> {
  function next_back (line 1936) | pub fn next_back(&mut self, guard: &Guard) -> Option<RefEntry<'a, K, V, ...
  function drop_impl (line 1967) | pub fn drop_impl(&mut self, guard: &Guard) {
  type Range (line 1979) | pub struct Range<'a: 'g, 'g, Q, R, K, V, C = BasicComparator>
  type Item (line 1999) | type Item = Entry<'a, 'g, K, V, C>;
  method next (line 2001) | fn next(&mut self) -> Option<Self::Item> {
  method next_back (line 2042) | fn next_back(&mut self) -> Option<Self::Item> {
  function fmt (line 2085) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  type RefRange (line 2095) | pub struct RefRange<'a, Q, R, K, V, C = BasicComparator>
  function fmt (line 2132) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  function next (line 2148) | pub fn next(&mut self, guard: &Guard) -> Option<RefEntry<'a, K, V, C>> {
  function next_back (line 2196) | pub fn next_back(&mut self, guard: &Guard) -> Option<RefEntry<'a, K, V, ...
  function drop_impl (line 2244) | pub fn drop_impl(&mut self, guard: &Guard) {
  type IntoIter (line 2256) | pub struct IntoIter<K, V> {
  method drop (line 2264) | fn drop(&mut self) {
  type Item (line 2286) | type Item = (K, V);
  method next (line 2288) | fn next(&mut self) -> Option<Self::Item> {
  function fmt (line 2325) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  function try_pin_loop (line 2332) | pub(crate) fn try_pin_loop<'a: 'g, 'g, F, K, V, C>(mut f: F) -> Option<R...
  function above_lower_bound (line 2344) | fn above_lower_bound<V, T, C>(comparator: &C, bound: &Bound<&T>, other: ...
  function below_upper_bound (line 2357) | fn below_upper_bound<V, T, C>(comparator: &C, bound: &Bound<&T>, other: ...

FILE: crossbeam-skiplist/src/comparator.rs
  type Equivalator (line 48) | pub trait Equivalator<L: ?Sized, R: ?Sized = L> {
    method equivalent (line 50) | fn equivalent(&self, lhs: &L, rhs: &R) -> bool;
  type Comparator (line 66) | pub trait Comparator<L: ?Sized, R: ?Sized = L>: Equivalator<L, R> {
    method compare (line 68) | fn compare(&self, lhs: &L, rhs: &R) -> Ordering;
  type BasicComparator (line 76) | pub struct BasicComparator;
    method equivalent (line 83) | fn equivalent(&self, lhs: &K, rhs: &Q) -> bool {
    method compare (line 93) | fn compare(&self, lhs: &K, rhs: &Q) -> Ordering {

FILE: crossbeam-skiplist/src/equivalent.rs
  type Equivalent (line 18) | pub trait Equivalent<Q: ?Sized> {
    method equivalent (line 20) | fn equivalent(&self, key: &Q) -> bool;
  method equivalent (line 29) | fn equivalent(&self, key: &Q) -> bool {
  type Comparable (line 40) | pub trait Comparable<Q: ?Sized>: Equivalent<Q> {
    method compare (line 42) | fn compare(&self, key: &Q) -> Ordering;
  method compare (line 51) | fn compare(&self, key: &Q) -> Ordering {

FILE: crossbeam-skiplist/src/map.rs
  type SkipMap (line 28) | pub struct SkipMap<K, V, C = BasicComparator> {
  function new (line 42) | pub fn new() -> Self {
  function with_comparator (line 59) | pub fn with_comparator(comparator: C) -> Self {
  function is_empty (line 77) | pub fn is_empty(&self) -> bool {
  function len (line 100) | pub fn len(&self) -> usize {
  function front (line 124) | pub fn front(&self) -> Option<Entry<'_, K, V, C>> {
  function back (line 144) | pub fn back(&self) -> Option<Entry<'_, K, V, C>> {
  function get_or_insert (line 166) | pub fn get_or_insert(&self, key: K, value: V) -> Entry<'_, K, V, C> {
  function get_or_insert_with (line 194) | pub fn get_or_insert_with<F>(&self, key: K, value_fn: F) -> Entry<'_, K,...
  function iter (line 224) | pub fn iter(&self) -> Iter<'_, K, V, C> {
  function contains_key (line 247) | pub fn contains_key<Q>(&self, key: &Q) -> bool
  function get (line 271) | pub fn get<Q>(&self, key: &Q) -> Option<Entry<'_, K, V, C>>
  function lower_bound (line 306) | pub fn lower_bound<'a, Q>(&'a self, bound: Bound<&Q>) -> Option<Entry<'a...
  function upper_bound (line 338) | pub fn upper_bound<'a, Q>(&'a self, bound: Bound<&Q>) -> Option<Entry<'a...
  function range (line 368) | pub fn range<Q, R>(&self, range: R) -> Range<'_, Q, R, K, V, C>
  function insert (line 403) | pub fn insert(&self, key: K, value: V) -> Entry<'_, K, V, C> {
  function compare_insert (line 430) | pub fn compare_insert<F>(&self, key: K, value: V, compare_fn: F) -> Entr...
  function remove (line 456) | pub fn remove<Q>(&self, key: &Q) -> Option<Entry<'_, K, V, C>>
  function pop_front (line 487) | pub fn pop_front(&self) -> Option<Entry<'_, K, V, C>> {
  function pop_back (line 514) | pub fn pop_back(&self) -> Option<Entry<'_, K, V, C>> {
  function clear (line 532) | pub fn clear(&self) {
  method default (line 542) | fn default() -> Self {
  function fmt (line 552) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  type Item (line 558) | type Item = (K, V);
  type IntoIter (line 559) | type IntoIter = IntoIter<K, V>;
  method into_iter (line 561) | fn into_iter(self) -> Self::IntoIter {
  type Item (line 572) | type Item = Entry<'a, K, V, C>;
  type IntoIter (line 573) | type IntoIter = Iter<'a, K, V, C>;
  method into_iter (line 575) | fn into_iter(self) -> Self::IntoIter {
  function from_iter (line 584) | fn from_iter<I>(iter: I) -> Self
  type Entry (line 597) | pub struct Entry<'a, K, V, C = BasicComparator> {
  function new (line 602) | fn new(inner: base::RefEntry<'a, K, V, C>) -> Self {
  function key (line 609) | pub fn key(&self) -> &'a K {
  function value (line 614) | pub fn value(&self) -> &'a V {
  function is_removed (line 619) | pub fn is_removed(&self) -> bool {
  method drop (line 625) | fn drop(&mut self) {
  function move_next (line 637) | pub fn move_next(&mut self) -> bool {
  function move_prev (line 643) | pub fn move_prev(&mut self) -> bool {
  function next (line 649) | pub fn next(&self) -> Option<Self> {
  function prev (line 655) | pub fn prev(&self) -> Option<Self> {
  function remove (line 670) | pub fn remove(&self) -> bool {
  method clone (line 677) | fn clone(&self) -> Self {
  function fmt (line 689) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  type IntoIter (line 698) | pub struct IntoIter<K, V> {
  type Item (line 703) | type Item = (K, V);
  method next (line 705) | fn next(&mut self) -> Option<Self::Item> {
  function fmt (line 711) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  type Iter (line 717) | pub struct Iter<'a, K, V, C = BasicComparator> {
  type Item (line 725) | type Item = Entry<'a, K, V, C>;
  method next (line 727) | fn next(&mut self) -> Option<Entry<'a, K, V, C>> {
  method next_back (line 737) | fn next_back(&mut self) -> Option<Entry<'a, K, V, C>> {
  function fmt (line 744) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  method drop (line 750) | fn drop(&mut self) {
  type Range (line 757) | pub struct Range<'a, Q, R, K, V, C = BasicComparator>
  type Item (line 772) | type Item = Entry<'a, K, V, C>;
  method next (line 774) | fn next(&mut self) -> Option<Entry<'a, K, V, C>> {
  method next_back (line 786) | fn next_back(&mut self) -> Option<Entry<'a, K, V, C>> {
  function fmt (line 800) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  method drop (line 815) | fn drop(&mut self) {

FILE: crossbeam-skiplist/src/set.rs
  type SkipSet (line 24) | pub struct SkipSet<T, C = BasicComparator> {
  function new (line 38) | pub fn new() -> Self {
  function with_comparator (line 55) | pub fn with_comparator(comparator: C) -> Self {
  function is_empty (line 74) | pub fn is_empty(&self) -> bool {
  function len (line 94) | pub fn len(&self) -> usize {
  function front (line 116) | pub fn front(&self) -> Option<Entry<'_, T, C>> {
  function back (line 133) | pub fn back(&self) -> Option<Entry<'_, T, C>> {
  function contains (line 148) | pub fn contains<Q>(&self, key: &Q) -> bool
  function get (line 167) | pub fn get<Q>(&self, key: &Q) -> Option<Entry<'_, T, C>>
  function lower_bound (line 199) | pub fn lower_bound<'a, Q>(&'a self, bound: Bound<&Q>) -> Option<Entry<'a...
  function upper_bound (line 228) | pub fn upper_bound<'a, Q>(&'a self, bound: Bound<&Q>) -> Option<Entry<'a...
  function get_or_insert (line 247) | pub fn get_or_insert(&self, key: T) -> Entry<'_, T, C> {
  function iter (line 269) | pub fn iter(&self) -> Iter<'_, T, C> {
  function range (line 292) | pub fn range<Q, R>(&self, range: R) -> Range<'_, Q, R, T, C>
  function insert (line 323) | pub fn insert(&self, key: T) -> Entry<'_, T, C> {
  function remove (line 342) | pub fn remove<Q>(&self, key: &Q) -> Option<Entry<'_, T, C>>
  function pop_front (line 371) | pub fn pop_front(&self) -> Option<Entry<'_, T, C>> {
  function pop_back (line 396) | pub fn pop_back(&self) -> Option<Entry<'_, T, C>> {
  function clear (line 414) | pub fn clear(&self) {
  method default (line 423) | fn default() -> Self {
  function fmt (line 433) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  type Item (line 439) | type Item = T;
  type IntoIter (line 440) | type IntoIter = IntoIter<T>;
  method into_iter (line 442) | fn into_iter(self) -> Self::IntoIter {
  type Item (line 453) | type Item = Entry<'a, T, C>;
  type IntoIter (line 454) | type IntoIter = Iter<'a, T, C>;
  method into_iter (line 456) | fn into_iter(self) -> Self::IntoIter {
  function from_iter (line 465) | fn from_iter<I>(iter: I) -> Self
  type Entry (line 478) | pub struct Entry<'a, T, C = BasicComparator> {
  function new (line 483) | fn new(inner: map::Entry<'a, T, (), C>) -> Self {
  function value (line 488) | pub fn value(&self) -> &'a T {
  function is_removed (line 493) | pub fn is_removed(&self) -> bool {
  function move_next (line 503) | pub fn move_next(&mut self) -> bool {
  function move_prev (line 508) | pub fn move_prev(&mut self) -> bool {
  function next (line 513) | pub fn next(&self) -> Option<Self> {
  function prev (line 518) | pub fn prev(&self) -> Option<Self> {
  function remove (line 531) | pub fn remove(&self) -> bool {
  method clone (line 537) | fn clone(&self) -> Self {
  function fmt (line 548) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  type Target (line 556) | type Target = T;
  method deref (line 558) | fn deref(&self) -> &Self::Target {
  type IntoIter (line 564) | pub struct IntoIter<T> {
  type Item (line 569) | type Item = T;
  method next (line 571) | fn next(&mut self) -> Option<Self::Item> {
  function fmt (line 577) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  type Iter (line 583) | pub struct Iter<'a, T, C = BasicComparator> {
  type Item (line 591) | type Item = Entry<'a, T, C>;
  method next (line 593) | fn next(&mut self) -> Option<Self::Item> {
  method next_back (line 602) | fn next_back(&mut self) -> Option<Self::Item> {
  function fmt (line 608) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  type Range (line 614) | pub struct Range<'a, Q, R, T, C = BasicComparator>
  type Item (line 629) | type Item = Entry<'a, T, C>;
  method next (line 631) | fn next(&mut self) -> Option<Self::Item> {
  method next_back (line 642) | fn next_back(&mut self) -> Option<Self::Item> {
  function fmt (line 654) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {

FILE: crossbeam-skiplist/tests/base.rs
  function ref_entry (line 11) | fn ref_entry<'a, K, V>(e: impl Into<Option<base::RefEntry<'a, K, V>>>) -...
  type Entry (line 14) | struct Entry<'a, K, V>(Option<base::RefEntry<'a, K, V>>);
  function value (line 16) | fn value(&self) -> &V {
  method drop (line 21) | fn drop(&mut self) {
  function new (line 29) | fn new() {
  function is_empty (line 35) | fn is_empty() {
  function insert (line 57) | fn insert() {
  function remove (line 74) | fn remove() {
  function entry (line 110) | fn entry() {
  function entry_remove (line 135) | fn entry_remove() {
  function entry_reposition (line 162) | fn entry_reposition() {
  function len (line 182) | fn len() {
  function insert_and_remove (line 206) | fn insert_and_remove() {
  function get (line 255) | fn get() {
  function lower_bound (line 277) | fn lower_bound() {
  function upper_bound (line 357) | fn upper_bound() {
  function get_or_insert (line 437) | fn get_or_insert() {
  function get_or_insert_with (line 456) | fn get_or_insert_with() {
  function get_or_insert_with_panic (line 475) | fn get_or_insert_with_panic() {
  function get_or_insert_with_parallel_run (line 491) | fn get_or_insert_with_parallel_run() {
  function get_next_prev (line 526) | fn get_next_prev() {
  function front_and_back (line 560) | fn front_and_back() {
  function iter (line 575) | fn iter() {
  function iter_range (line 600) | fn iter_range() {
  function into_iter (line 822) | fn into_iter() {
  function clear (line 844) | fn clear() {
  function drops (line 859) | fn drops() {
  function comparable_get (line 907) | fn comparable_get() {
  function remove_race (line 978) | fn remove_race() {

FILE: crossbeam-skiplist/tests/map.rs
  function smoke (line 12) | fn smoke() {
  function is_empty (line 20) | fn is_empty() {
  function insert (line 41) | fn insert() {
  function compare_and_insert (line 57) | fn compare_and_insert() {
  function compare_insert_with_absent_key (line 85) | fn compare_insert_with_absent_key() {
  function remove (line 99) | fn remove() {
  function concurrent_insert (line 135) | fn concurrent_insert() {
  function concurrent_compare_and_insert (line 154) | fn concurrent_compare_and_insert() {
  function concurrent_remove (line 174) | fn concurrent_remove() {
  function next_memory_leak (line 193) | fn next_memory_leak() {
  function next_back_memory_leak (line 204) | fn next_back_memory_leak() {
  function range_next_memory_leak (line 216) | fn range_next_memory_leak() {
  function entry (line 227) | fn entry() {
  function ordered_iter (line 251) | fn ordered_iter() {
  function ordered_range (line 278) | fn ordered_range() {
  function entry_remove (line 304) | fn entry_remove() {
  function entry_reposition (line 330) | fn entry_reposition() {
  function len (line 349) | fn len() {
  function insert_and_remove (line 372) | fn insert_and_remove() {
  function get (line 420) | fn get() {
  function lower_bound (line 441) | fn lower_bound() {
  function upper_bound (line 475) | fn upper_bound() {
  function get_or_insert (line 509) | fn get_or_insert() {
  function get_or_insert_with (line 527) | fn get_or_insert_with() {
  function get_or_insert_with_panic (line 545) | fn get_or_insert_with_panic() {
  function get_or_insert_with_parallel_run (line 559) | fn get_or_insert_with_parallel_run() {
  function get_next_prev (line 588) | fn get_next_prev() {
  function front_and_back (line 621) | fn front_and_back() {
  function iter (line 635) | fn iter() {
  function iter_range (line 659) | fn iter_range() {
  function iter_range2 (line 888) | fn iter_range2() {
  function into_iter (line 895) | fn into_iter() {
  function clear (line 916) | fn clear() {
  function concurrent_insert_get_same_key (line 931) | fn concurrent_insert_get_same_key() {
  function issue_1178 (line 951) | fn issue_1178() {
  function comparator (line 968) | fn comparator() {

FILE: crossbeam-skiplist/tests/set.rs
  function smoke (line 11) | fn smoke() {
  function is_empty (line 19) | fn is_empty() {
  function insert (line 40) | fn insert() {
  function remove (line 56) | fn remove() {
  function concurrent_insert (line 92) | fn concurrent_insert() {
  function concurrent_remove (line 112) | fn concurrent_remove() {
  function entry (line 131) | fn entry() {
  function entry_remove (line 155) | fn entry_remove() {
  function entry_reposition (line 181) | fn entry_reposition() {
  function len (line 200) | fn len() {
  function insert_and_remove (line 223) | fn insert_and_remove() {
  function get (line 271) | fn get() {
  function lower_bound (line 292) | fn lower_bound() {
  function upper_bound (line 326) | fn upper_bound() {
  function get_or_insert (line 360) | fn get_or_insert() {
  function get_next_prev (line 378) | fn get_next_prev() {
  function front_and_back (line 411) | fn front_and_back() {
  function iter (line 425) | fn iter() {
  function iter_range (line 449) | fn iter_range() {
  function iter_range2 (line 671) | fn iter_range2() {
  function into_iter (line 678) | fn into_iter() {
  function clear (line 688) | fn clear() {
  function concurrent_insert_get_same_key (line 703) | fn concurrent_insert_get_same_key() {
  function comparator (line 722) | fn comparator() {

FILE: crossbeam-utils/benches/atomic_cell.rs
  function load_u8 (line 10) | fn load_u8(b: &mut test::Bencher) {
  function store_u8 (line 18) | fn store_u8(b: &mut test::Bencher) {
  function fetch_add_u8 (line 24) | fn fetch_add_u8(b: &mut test::Bencher) {
  function compare_exchange_u8 (line 30) | fn compare_exchange_u8(b: &mut test::Bencher) {
  function concurrent_load_u8 (line 40) | fn concurrent_load_u8(b: &mut test::Bencher) {
  function load_usize (line 86) | fn load_usize(b: &mut test::Bencher) {
  function store_usize (line 94) | fn store_usize(b: &mut test::Bencher) {
  function fetch_add_usize (line 100) | fn fetch_add_usize(b: &mut test::Bencher) {
  function compare_exchange_usize (line 106) | fn compare_exchange_usize(b: &mut test::Bencher) {
  function concurrent_load_usize (line 116) | fn concurrent_load_usize(b: &mut test::Bencher) {

FILE: crossbeam-utils/build.rs
  function main (line 18) | fn main() {

FILE: crossbeam-utils/src/alloc_helper.rs
  type Global (line 7) | pub(crate) struct Global;
    method alloc_impl (line 12) | fn alloc_impl(&self, layout: Layout, zeroed: bool) -> Option<NonNull<u...
    method allocate (line 38) | pub(crate) fn allocate(self, layout: Layout) -> Option<NonNull<u8>> {
    method allocate_zeroed (line 44) | pub(crate) fn allocate_zeroed(self, layout: Layout) -> Option<NonNull<...
    method deallocate (line 50) | pub(crate) unsafe fn deallocate(self, ptr: NonNull<u8>, layout: Layout) {
  function without_provenance_mut (line 70) | const fn without_provenance_mut<T>(addr: usize) -> *mut T {

FILE: crossbeam-utils/src/atomic/atomic_cell.rs
  type AtomicCell (line 33) | pub struct AtomicCell<T> {
  function new (line 66) | pub const fn new(val: T) -> Self {
  function into_inner (line 87) | pub const fn into_inner(self) -> T {
  function is_lock_free (line 160) | pub const fn is_lock_free() -> bool {
  function store (line 177) | pub fn store(&self, val: T) {
  function swap (line 200) | pub fn swap(&self, val: T) -> T {
  function as_ptr (line 216) | pub const fn as_ptr(&self) -> *mut T {
  function take (line 235) | pub fn take(&self) -> T {
  function load (line 252) | pub fn load(&self) -> T {
  function compare_exchange (line 276) | pub fn compare_exchange(&self, current: T, new: T) -> Result<T, T> {
  function fetch_update (line 300) | pub fn fetch_update<F>(&self, mut f: F) -> Result<T, T>
  method drop (line 318) | fn drop(&mut self) {
  function fetch_and (line 780) | pub fn fetch_and(&self, val: bool) -> bool {
  function fetch_nand (line 823) | pub fn fetch_nand(&self, val: bool) -> bool {
  function fetch_or (line 863) | pub fn fetch_or(&self, val: bool) -> bool {
  function fetch_xor (line 903) | pub fn fetch_xor(&self, val: bool) -> bool {
  method default (line 929) | fn default() -> Self {
  function from (line 936) | fn from(val: T) -> Self {
  function fmt (line 942) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  function can_transmute (line 950) | const fn can_transmute<A, B>() -> bool {
  function lock (line 965) | fn lock(addr: usize) -> &'static SeqLock {
  type AtomicUnit (line 1000) | struct AtomicUnit;
    method load (line 1004) | fn load(&self, _order: Ordering) {}
    method store (line 1007) | fn store(&self, _val: (), _order: Ordering) {}
    method swap (line 1010) | fn swap(&self, _val: (), _order: Ordering) {}
    method compare_exchange_weak (line 1013) | fn compare_exchange_weak(
  function atomic_is_lock_free (line 1025) | const fn atomic_is_lock_free<T>() -> bool {
  function atomic_load (line 1033) | unsafe fn atomic_load<T>(src: *mut T) -> T
  function atomic_store (line 1075) | unsafe fn atomic_store<T>(dst: *mut T, val: T) {
  function atomic_swap (line 1094) | unsafe fn atomic_swap<T>(dst: *mut T, val: T) -> T {
  function atomic_compare_exchange_weak (line 1118) | unsafe fn atomic_compare_exchange_weak<T>(dst: *mut T, mut current: T, n...

FILE: crossbeam-utils/src/atomic/consume.rs
  type AtomicConsume (line 5) | pub trait AtomicConsume {
    method load_consume (line 24) | fn load_consume(&self) -> Self::Val;
    type Val (line 103) | type Val = *mut T;
    type Val (line 109) | type Val = *mut T;

FILE: crossbeam-utils/src/atomic/seq_lock.rs
  type SeqLock (line 9) | pub(crate) struct SeqLock {
    method new (line 18) | pub(crate) const fn new() -> Self {
    method optimistic_read (line 28) | pub(crate) fn optimistic_read(&self) -> Option<usize> {
    method validate_read (line 38) | pub(crate) fn validate_read(&self, stamp: usize) -> bool {
    method write (line 45) | pub(crate) fn write(&'static self) -> SeqLockWriteGuard {
  type SeqLockWriteGuard (line 65) | pub(crate) struct SeqLockWriteGuard {
    method abort (line 76) | pub(crate) fn abort(self) {
  method drop (line 87) | fn drop(&mut self) {
  function test_abort (line 100) | fn test_abort() {

FILE: crossbeam-utils/src/atomic/seq_lock_wide.rs
  type SeqLock (line 12) | pub(crate) struct SeqLock {
    method new (line 24) | pub(crate) const fn new() -> Self {
    method optimistic_read (line 35) | pub(crate) fn optimistic_read(&self) -> Option<(usize, usize)> {
    method validate_read (line 56) | pub(crate) fn validate_read(&self, stamp: (usize, usize)) -> bool {
    method write (line 81) | pub(crate) fn write(&'static self) -> SeqLockWriteGuard {
  type SeqLockWriteGuard (line 103) | pub(crate) struct SeqLockWriteGuard {
    method abort (line 114) | pub(crate) fn abort(self) {
  method drop (line 122) | fn drop(&mut self) {
  function test_abort (line 147) | fn test_abort() {

FILE: crossbeam-utils/src/backoff.rs
  constant SPIN_LIMIT (line 5) | const SPIN_LIMIT: u32 = 6;
  constant YIELD_LIMIT (line 6) | const YIELD_LIMIT: u32 = 10;
  type Backoff (line 80) | pub struct Backoff {
    method new (line 95) | pub fn new() -> Self {
    method reset (line 110) | pub fn reset(&self) {
    method spin (line 146) | pub fn spin(&self) {
    method snooze (line 207) | pub fn snooze(&self) {
    method is_completed (line 271) | pub fn is_completed(&self) -> bool {
    method fmt (line 277) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  method default (line 286) | fn default() -> Self {

FILE: crossbeam-utils/src/cache_padded.rs
  type CachePadded (line 150) | pub struct CachePadded<T> {
  function new (line 167) | pub const fn new(t: T) -> Self {
  function into_inner (line 182) | pub fn into_inner(self) -> T {
  type Target (line 188) | type Target = T;
  method deref (line 190) | fn deref(&self) -> &T {
  method deref_mut (line 196) | fn deref_mut(&mut self) -> &mut T {
  function fmt (line 202) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  function from (line 210) | fn from(t: T) -> Self {
  function fmt (line 216) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {

FILE: crossbeam-utils/src/sync/once_lock.rs
  type OnceLock (line 8) | pub(crate) struct OnceLock<T> {
  function new (line 21) | pub(crate) const fn new() -> Self {
  function get_or_init (line 43) | pub(crate) fn get_or_init<F>(&self, f: F) -> &T
  function initialize (line 59) | fn initialize<F>(&self, f: F)
  function get_unchecked (line 74) | unsafe fn get_unchecked(&self) -> &T {
  method drop (line 81) | fn drop(&mut self) {

FILE: crossbeam-utils/src/sync/parker.rs
  type Parker (line 56) | pub struct Parker {
    method new (line 89) | pub fn new() -> Self {
    method park (line 109) | pub fn park(&self) {
    method park_timeout (line 126) | pub fn park_timeout(&self, timeout: Duration) -> UnparkReason {
    method park_deadline (line 150) | pub fn park_deadline(&self, deadline: Instant) -> UnparkReason {
    method unparker (line 174) | pub fn unparker(&self) -> &Unparker {
    method into_raw (line 189) | pub fn into_raw(this: Self) -> *const () {
    method from_raw (line 208) | pub unsafe fn from_raw(ptr: *const ()) -> Self {
    method fmt (line 217) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  method default (line 64) | fn default() -> Self {
  type Unparker (line 223) | pub struct Unparker {
    method unpark (line 259) | pub fn unpark(&self) {
    method into_raw (line 275) | pub fn into_raw(this: Self) -> *const () {
    method from_raw (line 296) | pub unsafe fn from_raw(ptr: *const ()) -> Self {
    method fmt (line 304) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  method clone (line 310) | fn clone(&self) -> Self {
  type UnparkReason (line 321) | pub enum UnparkReason {
  constant EMPTY (line 329) | const EMPTY: usize = 0;
  constant PARKED (line 330) | const PARKED: usize = 1;
  constant NOTIFIED (line 331) | const NOTIFIED: usize = 2;
  type Inner (line 333) | struct Inner {
    method park (line 340) | fn park(&self, deadline: Option<Instant>) -> UnparkReason {
    method unpark (line 412) | pub(crate) fn unpark(&self) {

FILE: crossbeam-utils/src/sync/sharded_lock.rs
  constant NUM_SHARDS (line 22) | const NUM_SHARDS: usize = 8;
  type Shard (line 25) | struct Shard {
  type ShardedLock (line 82) | pub struct ShardedLock<T: ?Sized> {
  function new (line 106) | pub fn new(value: T) -> Self {
  function into_inner (line 139) | pub fn into_inner(self) -> LockResult<T> {
  function is_poisoned (line 173) | pub fn is_poisoned(&self) -> bool {
  function get_mut (line 195) | pub fn get_mut(&mut self) -> LockResult<&mut T> {
  function try_read (line 230) | pub fn try_read(&self) -> TryLockResult<ShardedLockReadGuard<'_, T>> {
  function read (line 290) | pub fn read(&self) -> LockResult<ShardedLockReadGuard<'_, T>> {
  function try_write (line 334) | pub fn try_write(&self) -> TryLockResult<ShardedLockWriteGuard<'_, T>> {
  function write (line 414) | pub fn write(&self) -> LockResult<ShardedLockWriteGuard<'_, T>> {
  function fmt (line 451) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  method default (line 477) | fn default() -> Self {
  function from (line 483) | fn from(t: T) -> Self {
  type ShardedLockReadGuard (line 490) | pub struct ShardedLockReadGuard<'a, T: ?Sized> {
  type Target (line 499) | type Target = T;
  method deref (line 501) | fn deref(&self) -> &T {
  function fmt (line 507) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  function fmt (line 515) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  type ShardedLockWriteGuard (line 522) | pub struct ShardedLockWriteGuard<'a, T: ?Sized> {
  method drop (line 530) | fn drop(&mut self) {
  function fmt (line 543) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  function fmt (line 551) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  type Target (line 557) | type Target = T;
  method deref (line 559) | fn deref(&self) -> &T {
  method deref_mut (line 565) | fn deref_mut(&mut self) -> &mut T {
  function current_index (line 578) | fn current_index() -> Option<usize> {
  type ThreadIndices (line 583) | struct ThreadIndices {
  function thread_indices (line 594) | fn thread_indices() -> &'static Mutex<ThreadIndices> {
  type Registration (line 609) | struct Registration {
  method drop (line 615) | fn drop(&mut self) {

FILE: crossbeam-utils/src/sync/wait_group.rs
  type WaitGroup (line 50) | pub struct WaitGroup {
    method new (line 83) | pub fn new() -> Self {
    method wait (line 110) | pub fn wait(self) {
    method fmt (line 154) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  type Inner (line 55) | struct Inner {
  method default (line 62) | fn default() -> Self {
  method drop (line 135) | fn drop(&mut self) {
  method clone (line 145) | fn clone(&self) -> Self {

FILE: crossbeam-utils/src/thread.rs
  type SharedVec (line 120) | type SharedVec<T> = Arc<Mutex<Vec<T>>>;
  type SharedOption (line 121) | type SharedOption<T> = Arc<Mutex<Option<T>>>;
  function scope (line 146) | pub fn scope<'env, F, R>(f: F) -> thread::Result<R>
  type Scope (line 206) | pub struct Scope<'env> {
  function spawn (line 258) | pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scop...
  function builder (line 282) | pub fn builder<'scope>(&'scope self) -> ScopedThreadBuilder<'scope, 'env> {
  function fmt (line 291) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  type ScopedThreadBuilder (line 330) | pub struct ScopedThreadBuilder<'scope, 'env> {
  function name (line 357) | pub fn name(mut self, name: String) -> Self {
  function stack_size (line 382) | pub fn stack_size(mut self, size: usize) -> Self {
  function spawn (line 424) | pub fn spawn<F, T>(self, f: F) -> io::Result<ScopedJoinHandle<'scope, T>>
  type ScopedJoinHandle (line 490) | pub struct ScopedJoinHandle<'scope, T> {
  function join (line 533) | pub fn join(self) -> thread::Result<T> {
  function thread (line 556) | pub fn thread(&self) -> &thread::Thread {
  type Sealed (line 571) | pub trait Sealed {}
  type JoinHandleExt (line 575) | pub trait JoinHandleExt: sealed::Sealed {
    method as_pthread_t (line 577) | fn as_pthread_t(&self) -> RawPthread;
    method into_pthread_t (line 584) | fn into_pthread_t(self) -> RawPthread;
    method as_pthread_t (line 589) | fn as_pthread_t(&self) -> RawPthread {
    method into_pthread_t (line 595) | fn into_pthread_t(self) -> RawPthread {
  method as_raw_handle (line 608) | fn as_raw_handle(&self) -> RawHandle {
  method into_raw_handle (line 617) | fn into_raw_handle(self) -> RawHandle {
  function fmt (line 624) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {

FILE: crossbeam-utils/tests/atomic_cell.rs
  function always_use_fallback (line 9) | fn always_use_fallback() -> bool {
  function is_lock_free (line 21) | fn is_lock_free() {
  function drops_unit (line 77) | fn drops_unit() {
  function drops_u8 (line 119) | fn drops_u8() {
  function drops_usize (line 165) | fn drops_usize() {
  function modular_u8 (line 211) | fn modular_u8() {
  function modular_usize (line 235) | fn modular_usize() {
  function garbage_padding (line 259) | fn garbage_padding() {
  function const_atomic_cell (line 276) | fn const_atomic_cell() {
  function issue_748 (line 342) | fn issue_748() {
  function issue_833 (line 362) | fn issue_833() {

FILE: crossbeam-utils/tests/cache_padded.rs
  function default (line 6) | fn default() {
  function store_u64 (line 12) | fn store_u64() {
  function store_pair (line 18) | fn store_pair() {
  function distance (line 25) | fn distance() {
  function different_sizes (line 35) | fn different_sizes() {
  function large (line 51) | fn large() {
  function debug (line 58) | fn debug() {
  function drops (line 66) | fn drops() {
  function clone (line 89) | fn clone() {
  function runs_custom_clone (line 96) | fn runs_custom_clone() {

FILE: crossbeam-utils/tests/parker.rs
  function park_timeout_unpark_before (line 9) | fn park_timeout_unpark_before() {
  function park_timeout_unpark_not_called (line 21) | fn park_timeout_unpark_not_called() {
  function park_timeout_unpark_called_other_thread (line 32) | fn park_timeout_unpark_called_other_thread() {

FILE: crossbeam-utils/tests/sharded_lock.rs
  type NonCopy (line 13) | struct NonCopy(i32);
  function smoke (line 16) | fn smoke() {
  function frob (line 25) | fn frob() {
  function arc_poison_wr (line 52) | fn arc_poison_wr() {
  function arc_poison_ww (line 64) | fn arc_poison_ww() {
  function arc_no_poison_rr (line 78) | fn arc_no_poison_rr() {
  function arc_no_poison_sl (line 90) | fn arc_no_poison_sl() {
  function arc (line 103) | fn arc() {
  function arc_access_in_unwind (line 141) | fn arc_access_in_unwind() {
  function unsized_type (line 163) | fn unsized_type() {
  function try_write (line 175) | fn try_write() {
  function test_into_inner (line 190) | fn test_into_inner() {
  function test_into_inner_drop (line 196) | fn test_into_inner_drop() {
  function test_into_inner_poison (line 214) | fn test_into_inner_poison() {
  function test_get_mut (line 231) | fn test_get_mut() {
  function test_get_mut_poison (line 238) | fn test_get_mut_poison() {

FILE: crossbeam-utils/tests/thread.rs
  constant THREADS (line 10) | const THREADS: usize = 10;
  constant SMALL_STACK_SIZE (line 11) | const SMALL_STACK_SIZE: usize = 20;
  function join (line 14) | fn join() {
  function counter (line 34) | fn counter() {
  function counter_builder (line 49) | fn counter_builder() {
  function counter_panic (line 69) | fn counter_panic() {
  function panic_twice (line 89) | fn panic_twice() {
  function panic_many (line 113) | fn panic_many() {
  function nesting (line 137) | fn nesting() {
  function join_nested (line 169) | fn join_nested() {
  function scope_returns_ok (line 184) | fn scope_returns_ok() {
  function as_pthread_t (line 191) | fn as_pthread_t() {
  function as_raw_handle (line 206) | fn as_raw_handle() {

FILE: crossbeam-utils/tests/wait_group.rs
  constant THREADS (line 5) | const THREADS: usize = 10;
  function wait (line 8) | fn wait() {
  function wait_and_drop (line 37) | fn wait_and_drop() {

FILE: no_atomic.rs
  constant NO_ATOMIC (line 4) | const NO_ATOMIC: &[&str] = &[

FILE: tests/subcrates.rs
  function channel (line 6) | fn channel() {
  function deque (line 16) | fn deque() {
  function epoch (line 23) | fn epoch() {
  function queue (line 28) | fn queue() {
  function utils (line 35) | fn utils() {
Condensed preview — 176 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,587K chars).
[
  {
    "path": ".clippy.toml",
    "chars": 726,
    "preview": "# Clippy configuration\n# https://doc.rust-lang.org/nightly/clippy/lint_configuration.html\n\nallow-private-module-inceptio"
  },
  {
    "path": ".editorconfig",
    "chars": 499,
    "preview": "# EditorConfig configuration\n# https://editorconfig.org\n\nroot = true\n\n[*]\ncharset = utf-8\nend_of_line = lf\nindent_size ="
  },
  {
    "path": ".github/dependabot.yml",
    "chars": 299,
    "preview": "version: 2\nupdates:\n  - package-ecosystem: cargo\n    directory: /\n    schedule:\n      interval: weekly\n    commit-messag"
  },
  {
    "path": ".github/workflows/ci.yml",
    "chars": 8343,
    "preview": "name: CI\n\npermissions:\n  contents: read\n\non:\n  pull_request:\n  push:\n    branches:\n      - master\n  schedule:\n    - cron"
  },
  {
    "path": ".github/workflows/release.yml",
    "chars": 1259,
    "preview": "name: Release\n\npermissions:\n  contents: read\n\non:\n  push:\n    tags:\n      - crossbeam-[0-9]+.*\n      - crossbeam-[a-z]+-"
  },
  {
    "path": ".gitignore",
    "chars": 91,
    "preview": "/crossbeam-channel/benchmarks/*.txt\n/crossbeam-channel/benchmarks/*.png\ntarget/\nCargo.lock\n"
  },
  {
    "path": ".rustfmt.toml",
    "chars": 589,
    "preview": "# Rustfmt configuration\n# https://github.com/rust-lang/rustfmt/blob/HEAD/Configurations.md\n\n# Override the default forma"
  },
  {
    "path": ".shellcheckrc",
    "chars": 1225,
    "preview": "# ShellCheck configuration\n# https://github.com/koalaman/shellcheck/blob/HEAD/shellcheck.1.md#rc-files\n\n# See also:\n# ht"
  },
  {
    "path": ".taplo.toml",
    "chars": 225,
    "preview": "# Taplo configuration\n# https://taplo.tamasfe.dev/configuration/formatter-options.html\n\n[formatting]\nalign_comments = fa"
  },
  {
    "path": "CHANGELOG.md",
    "chars": 3103,
    "preview": "# Version 0.8.4\n\n- Remove dependency on `cfg-if`. (#1072)\n\n# Version 0.8.3\n\n- Bump the minimum supported Rust version to"
  },
  {
    "path": "Cargo.toml",
    "chars": 3604,
    "preview": "[package]\nname = \"crossbeam\"\n# When publishing a new version:\n# - Update CHANGELOG.md\n# - Update README.md (when increas"
  },
  {
    "path": "LICENSE-APACHE",
    "chars": 10852,
    "preview": "                              Apache License\n                        Version 2.0, January 2004\n                     http"
  },
  {
    "path": "LICENSE-MIT",
    "chars": 1099,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2019 The Crossbeam Project Developers\n\nPermission is hereby granted, free of charge"
  },
  {
    "path": "README.md",
    "chars": 6985,
    "preview": "# Crossbeam\n\n[![Build Status](https://github.com/crossbeam-rs/crossbeam/workflows/CI/badge.svg)](\nhttps://github.com/cro"
  },
  {
    "path": "build-common.rs",
    "chars": 482,
    "preview": "// The target triplets have the form of 'arch-vendor-system'.\n//\n// When building for Linux (e.g. the 'system' part is\n/"
  },
  {
    "path": "ci/careful.sh",
    "chars": 204,
    "preview": "#!/bin/bash\nset -euxo pipefail\nIFS=$'\\n\\t'\ncd \"$(dirname \"$0\")\"/..\n\nexport RUSTFLAGS=\"${RUSTFLAGS:-} -Z randomize-layout"
  },
  {
    "path": "ci/check-features.sh",
    "chars": 1599,
    "preview": "#!/bin/bash\nset -euxo pipefail\nIFS=$'\\n\\t'\ncd \"$(dirname \"$0\")\"/..\n\n# * `--feature-powerset` - run for the feature power"
  },
  {
    "path": "ci/crossbeam-epoch-loom.sh",
    "chars": 429,
    "preview": "#!/bin/bash\nset -euxo pipefail\nIFS=$'\\n\\t'\ncd \"$(dirname \"$0\")\"/../crossbeam-epoch\n\nexport RUSTFLAGS=\"${RUSTFLAGS:-} --c"
  },
  {
    "path": "ci/dependencies.sh",
    "chars": 206,
    "preview": "#!/bin/bash\nset -euxo pipefail\nIFS=$'\\n\\t'\ncd \"$(dirname \"$0\")\"/..\n\ncargo tree\ncargo tree --duplicate\n\n# Check minimal v"
  },
  {
    "path": "ci/miri.sh",
    "chars": 2076,
    "preview": "#!/bin/bash\nset -euxo pipefail\nIFS=$'\\n\\t'\ncd \"$(dirname \"$0\")\"/..\n\ngroup=$1\n\n# We need 'ts' for the per-line timing\nsud"
  },
  {
    "path": "ci/no_atomic.sh",
    "chars": 1194,
    "preview": "#!/bin/bash\nset -euo pipefail\nIFS=$'\\n\\t'\ncd \"$(dirname \"$0\")\"/..\n\n# Update the list of targets that do not support atom"
  },
  {
    "path": "ci/san.sh",
    "chars": 1502,
    "preview": "#!/bin/bash\nset -euxo pipefail\nIFS=$'\\n\\t'\ncd \"$(dirname \"$0\")\"/..\n\nif [[ \"${OSTYPE}\" != \"linux\"* ]]; then\n  exit 0\nfi\n\n"
  },
  {
    "path": "ci/test.sh",
    "chars": 848,
    "preview": "#!/bin/bash\nset -euxo pipefail\nIFS=$'\\n\\t'\ncd \"$(dirname \"$0\")\"/..\n\n# shellcheck disable=SC2086\nif [[ -n \"${RUST_TARGET:"
  },
  {
    "path": "ci/tsan",
    "chars": 432,
    "preview": "# TSAN suppressions file for crossbeam\n\n# Push and steal operations in crossbeam-deque may cause data races, but such\n# "
  },
  {
    "path": "crossbeam-channel/CHANGELOG.md",
    "chars": 7325,
    "preview": "# Version 0.5.15\n\n- Fix regression introduced in 0.5.12 that can lead to a double free when dropping unbounded channel. "
  },
  {
    "path": "crossbeam-channel/Cargo.toml",
    "chars": 1360,
    "preview": "[package]\nname = \"crossbeam-channel\"\n# When publishing a new version:\n# - Update CHANGELOG.md\n# - Update README.md (when"
  },
  {
    "path": "crossbeam-channel/LICENSE-APACHE",
    "chars": 10847,
    "preview": "                              Apache License\n                        Version 2.0, January 2004\n                     http"
  },
  {
    "path": "crossbeam-channel/LICENSE-MIT",
    "chars": 1099,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2019 The Crossbeam Project Developers\n\nPermission is hereby granted, free of charge"
  },
  {
    "path": "crossbeam-channel/LICENSE-THIRD-PARTY",
    "chars": 33447,
    "preview": "===============================================================================\n\nmatching.go\nhttps://creativecommons.org"
  },
  {
    "path": "crossbeam-channel/README.md",
    "chars": 3842,
    "preview": "# Crossbeam Channel\n\n[![Build Status](https://github.com/crossbeam-rs/crossbeam/workflows/CI/badge.svg)](\nhttps://github"
  },
  {
    "path": "crossbeam-channel/benches/crossbeam.rs",
    "chars": 19170,
    "preview": "#![feature(test)]\n\nextern crate test;\n\nuse std::num::NonZeroUsize;\n\nuse crossbeam_channel::{bounded, unbounded};\nuse cro"
  },
  {
    "path": "crossbeam-channel/benchmarks/Cargo.toml",
    "chars": 1077,
    "preview": "[package]\nname = \"benchmarks\"\nversion = \"0.0.0\"\nedition = \"2021\"\npublish = false\n\n[dependencies]\natomicring = \"1.2.9\"\nbu"
  },
  {
    "path": "crossbeam-channel/benchmarks/README.md",
    "chars": 1139,
    "preview": "# Benchmarks\n\n### Tests\n\n* `seq`: A single thread sends `N` messages. Then it receives `N` messages.\n* `spsc`: One threa"
  },
  {
    "path": "crossbeam-channel/benchmarks/atomicring.rs",
    "chars": 3431,
    "preview": "use std::thread;\n\nuse atomicring::AtomicRingBuffer;\n\nmod message;\n\nconst MESSAGES: usize = 5_000_000;\nconst THREADS: usi"
  },
  {
    "path": "crossbeam-channel/benchmarks/atomicringqueue.rs",
    "chars": 2873,
    "preview": "use std::thread;\n\nuse atomicring::AtomicRingQueue;\n\nmod message;\n\nconst MESSAGES: usize = 5_000_000;\nconst THREADS: usiz"
  },
  {
    "path": "crossbeam-channel/benchmarks/bus.rs",
    "chars": 1161,
    "preview": "use bus::Bus;\n\nmod message;\n\nconst MESSAGES: usize = 5_000_000;\n\nfn seq(cap: usize) {\n    let mut tx = Bus::new(cap);\n  "
  },
  {
    "path": "crossbeam-channel/benchmarks/crossbeam-channel.rs",
    "chars": 4988,
    "preview": "use crossbeam_channel::{Receiver, Select, Sender, bounded, unbounded};\n\nmod message;\n\nconst MESSAGES: usize = 5_000_000;"
  },
  {
    "path": "crossbeam-channel/benchmarks/crossbeam-deque.rs",
    "chars": 1507,
    "preview": "use std::thread;\n\nuse crossbeam_deque::{Steal, Worker};\n\nmod message;\n\nconst MESSAGES: usize = 5_000_000;\n\nfn seq() {\n  "
  },
  {
    "path": "crossbeam-channel/benchmarks/flume.rs",
    "chars": 3802,
    "preview": "mod message;\n\nconst MESSAGES: usize = 5_000_000;\nconst THREADS: usize = 4;\n\npub fn shuffle<T>(v: &mut [T]) {\n    use std"
  },
  {
    "path": "crossbeam-channel/benchmarks/futures-channel.rs",
    "chars": 4862,
    "preview": "use futures::{\n    SinkExt, StreamExt,\n    channel::mpsc,\n    executor::{ThreadPool, block_on},\n    future, stream,\n};\n\n"
  },
  {
    "path": "crossbeam-channel/benchmarks/go.go",
    "chars": 4294,
    "preview": "package main\n\nimport \"fmt\"\nimport \"time\"\n\nconst MESSAGES = 5 * 1000 * 1000\nconst THREADS = 4\n\ntype Message = uintptr\n\nfu"
  },
  {
    "path": "crossbeam-channel/benchmarks/lockfree.rs",
    "chars": 2364,
    "preview": "use lockfree::channel;\n\nmod message;\n\nconst MESSAGES: usize = 5_000_000;\nconst THREADS: usize = 4;\n\nuse std::thread;\n\nfn"
  },
  {
    "path": "crossbeam-channel/benchmarks/message.rs",
    "chars": 329,
    "preview": "use std::fmt;\n\nconst LEN: usize = 1;\n\n#[derive(Clone, Copy)]\npub(crate) struct Message(#[allow(dead_code)] [usize; LEN])"
  },
  {
    "path": "crossbeam-channel/benchmarks/mpmc.rs",
    "chars": 3339,
    "preview": "use std::thread;\n\nmod message;\n\nconst MESSAGES: usize = 5_000_000;\nconst THREADS: usize = 4;\n\nfn seq(cap: usize) {\n    l"
  },
  {
    "path": "crossbeam-channel/benchmarks/mpsc.rs",
    "chars": 3766,
    "preview": "use std::sync::mpsc;\n\nmod message;\n\nconst MESSAGES: usize = 5_000_000;\nconst THREADS: usize = 4;\n\npub fn shuffle<T>(v: &"
  },
  {
    "path": "crossbeam-channel/benchmarks/plot.py",
    "chars": 3800,
    "preview": "#!/usr/bin/env python3\nimport random\nimport sys\nimport matplotlib.pyplot as plt\n\n\ndef read_data(files):\n    results = []"
  },
  {
    "path": "crossbeam-channel/benchmarks/run.sh",
    "chars": 912,
    "preview": "#!/bin/bash\nset -euxo pipefail\nIFS=$'\\n\\t'\ncd \"$(dirname \"$0\")\"\n\ncargo run --release --bin crossbeam-channel | tee cross"
  },
  {
    "path": "crossbeam-channel/benchmarks/segqueue.rs",
    "chars": 2512,
    "preview": "use std::thread;\n\nuse crossbeam::queue::SegQueue;\n\nmod message;\n\nconst MESSAGES: usize = 5_000_000;\nconst THREADS: usize"
  },
  {
    "path": "crossbeam-channel/examples/fibonacci.rs",
    "chars": 554,
    "preview": "//! An asynchronous fibonacci sequence generator.\n\nuse std::thread;\n\nuse crossbeam_channel::{Sender, bounded};\n\n// Sends"
  },
  {
    "path": "crossbeam-channel/examples/matching.rs",
    "chars": 2354,
    "preview": "//! Using `select!` to send and receive on the same channel at the same time.\n//!\n//! This example is based on the follo"
  },
  {
    "path": "crossbeam-channel/examples/stopwatch.rs",
    "chars": 1445,
    "preview": "//! Prints the elapsed time every 1 second and quits on Ctrl+C.\n\n#[cfg(windows)] // signal_hook::iterator does not work "
  },
  {
    "path": "crossbeam-channel/src/channel.rs",
    "chars": 49827,
    "preview": "//! The channel interface.\n\nuse alloc::sync::Arc;\nuse core::{\n    fmt,\n    iter::FusedIterator,\n    mem,\n    panic::{Ref"
  },
  {
    "path": "crossbeam-channel/src/context.rs",
    "chars": 4986,
    "preview": "//! Thread-local context used in select.\n\nuse alloc::sync::Arc;\nuse core::{\n    cell::Cell,\n    ptr,\n    sync::atomic::{"
  },
  {
    "path": "crossbeam-channel/src/counter.rs",
    "chars": 4255,
    "preview": "//! Reference counter for channels.\n\nuse alloc::boxed::Box;\nuse core::{\n    ops,\n    ptr::NonNull,\n    sync::atomic::{At"
  },
  {
    "path": "crossbeam-channel/src/err.rs",
    "chars": 10142,
    "preview": "use core::fmt;\nuse std::error;\n\n/// An error returned from the [`send`] method.\n///\n/// The message could not be sent be"
  },
  {
    "path": "crossbeam-channel/src/flavors/array.rs",
    "chars": 21266,
    "preview": "//! Bounded channel based on a preallocated array.\n//!\n//! This flavor has a fixed, positive capacity.\n//!\n//! The imple"
  },
  {
    "path": "crossbeam-channel/src/flavors/at.rs",
    "chars": 5838,
    "preview": "//! Channel that delivers a message at a certain moment in time.\n//!\n//! Messages cannot be sent into this kind of chann"
  },
  {
    "path": "crossbeam-channel/src/flavors/list.rs",
    "chars": 26598,
    "preview": "//! Unbounded channel implemented as a linked list.\n\nuse alloc::{alloc::handle_alloc_error, boxed::Box};\nuse core::{\n   "
  },
  {
    "path": "crossbeam-channel/src/flavors/mod.rs",
    "chars": 544,
    "preview": "//! Channel flavors.\n//!\n//! There are six flavors:\n//!\n//! 1. `at` - Channel that delivers a message after a certain am"
  },
  {
    "path": "crossbeam-channel/src/flavors/never.rs",
    "chars": 2469,
    "preview": "//! Channel that never delivers messages.\n//!\n//! Messages cannot be sent into this kind of channel.\n\nuse core::marker::"
  },
  {
    "path": "crossbeam-channel/src/flavors/tick.rs",
    "chars": 5734,
    "preview": "//! Channel that delivers messages periodically.\n//!\n//! Messages cannot be sent into this kind of channel; they are mat"
  },
  {
    "path": "crossbeam-channel/src/flavors/zero.rs",
    "chars": 15508,
    "preview": "//! Zero-capacity channel.\n//!\n//! This kind of channel is also known as *rendezvous* channel.\n\nuse alloc::boxed::Box;\nu"
  },
  {
    "path": "crossbeam-channel/src/lib.rs",
    "chars": 11194,
    "preview": "//! Multi-producer multi-consumer channels for message passing.\n//!\n//! This crate is an alternative to [`std::sync::mps"
  },
  {
    "path": "crossbeam-channel/src/select.rs",
    "chars": 44746,
    "preview": "//! Interface to the select mechanism.\n\nuse alloc::vec::Vec;\nuse core::{fmt, marker::PhantomData, mem, time::Duration};\n"
  },
  {
    "path": "crossbeam-channel/src/select_macro.rs",
    "chars": 34367,
    "preview": "//! The `select!` macro.\n\n/// A helper macro for `select!` to hide the long list of macro patterns from the documentatio"
  },
  {
    "path": "crossbeam-channel/src/utils.rs",
    "chars": 1540,
    "preview": "//! Miscellaneous utilities.\n\nuse core::{cell::Cell, num::Wrapping, time::Duration};\nuse std::{thread, time::Instant};\n\n"
  },
  {
    "path": "crossbeam-channel/src/waker.rs",
    "chars": 8683,
    "preview": "//! Waking mechanism for threads blocked on channel operations.\n\nuse alloc::vec::Vec;\nuse core::{\n    ptr,\n    sync::ato"
  },
  {
    "path": "crossbeam-channel/tests/after.rs",
    "chars": 8029,
    "preview": "//! Tests for the after channel flavor.\n\n#![cfg(not(miri))] // TODO: many assertions failed due to Miri is slow\n\nuse std"
  },
  {
    "path": "crossbeam-channel/tests/array.rs",
    "chars": 16291,
    "preview": "//! Tests for the array channel flavor.\n\nuse std::{\n    any::Any,\n    sync::atomic::{AtomicUsize, Ordering},\n    thread,"
  },
  {
    "path": "crossbeam-channel/tests/golang.rs",
    "chars": 55194,
    "preview": "//! Tests copied from Go and manually rewritten in Rust.\n//!\n//! Source:\n//!   - https://github.com/golang/go\n//!\n//! Co"
  },
  {
    "path": "crossbeam-channel/tests/iter.rs",
    "chars": 2478,
    "preview": "//! Tests for iteration over receivers.\n\nuse crossbeam_channel::unbounded;\nuse crossbeam_utils::thread::scope;\n\n#[test]\n"
  },
  {
    "path": "crossbeam-channel/tests/list.rs",
    "chars": 12611,
    "preview": "//! Tests for the list channel flavor.\n\nuse std::{\n    any::Any,\n    sync::atomic::{AtomicUsize, Ordering},\n    thread,\n"
  },
  {
    "path": "crossbeam-channel/tests/mpsc.rs",
    "chars": 55112,
    "preview": "//! Tests copied from `std::sync::mpsc`.\n//!\n//! This is a copy of tests for the `std::sync::mpsc` channels from the sta"
  },
  {
    "path": "crossbeam-channel/tests/never.rs",
    "chars": 1830,
    "preview": "//! Tests for the never channel flavor.\n\nuse std::{\n    thread,\n    time::{Duration, Instant},\n};\n\nuse crossbeam_channel"
  },
  {
    "path": "crossbeam-channel/tests/ready.rs",
    "chars": 20960,
    "preview": "//! Tests for channel readiness using the `Select` struct.\n\nuse std::{\n    any::Any,\n    cell::Cell,\n    thread,\n    tim"
  },
  {
    "path": "crossbeam-channel/tests/same_channel.rs",
    "chars": 2445,
    "preview": "#![allow(clippy::redundant_clone)]\n\nuse std::time::Duration;\n\nuse crossbeam_channel::{after, bounded, never, tick, unbou"
  },
  {
    "path": "crossbeam-channel/tests/select.rs",
    "chars": 37961,
    "preview": "//! Tests for channel selection using the `Select` struct.\n\nuse std::{\n    any::Any,\n    cell::Cell,\n    thread,\n    tim"
  },
  {
    "path": "crossbeam-channel/tests/select_macro.rs",
    "chars": 35237,
    "preview": "//! Tests for the `select!` macro.\n\n#![forbid(unsafe_code)] // select! is safe.\n#![allow(clippy::match_single_binding)]\n"
  },
  {
    "path": "crossbeam-channel/tests/thread_locals.rs",
    "chars": 1487,
    "preview": "//! Tests that make sure accessing thread-locals while exiting the thread doesn't cause panics.\n\n#![cfg(not(miri))] // M"
  },
  {
    "path": "crossbeam-channel/tests/tick.rs",
    "chars": 9136,
    "preview": "//! Tests for the tick channel flavor.\n\n#![cfg(not(miri))] // TODO: many assertions failed due to Miri is slow\n\nuse std:"
  },
  {
    "path": "crossbeam-channel/tests/zero.rs",
    "chars": 13057,
    "preview": "//! Tests for the zero channel flavor.\n\nuse std::{\n    any::Any,\n    sync::atomic::{AtomicUsize, Ordering},\n    thread,\n"
  },
  {
    "path": "crossbeam-deque/CHANGELOG.md",
    "chars": 3764,
    "preview": "# Version 0.8.6\n\n- Fix stack overflow when pushing large value to `Injector`. (#1146, #1147, #1159)\n\n# Version 0.8.5\n\n- "
  },
  {
    "path": "crossbeam-deque/Cargo.toml",
    "chars": 1386,
    "preview": "[package]\nname = \"crossbeam-deque\"\n# When publishing a new version:\n# - Update CHANGELOG.md\n# - Update README.md (when i"
  },
  {
    "path": "crossbeam-deque/LICENSE-APACHE",
    "chars": 10847,
    "preview": "                              Apache License\n                        Version 2.0, January 2004\n                     http"
  },
  {
    "path": "crossbeam-deque/LICENSE-MIT",
    "chars": 1099,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2019 The Crossbeam Project Developers\n\nPermission is hereby granted, free of charge"
  },
  {
    "path": "crossbeam-deque/README.md",
    "chars": 1674,
    "preview": "# Crossbeam Deque\n\n[![Build Status](https://github.com/crossbeam-rs/crossbeam/workflows/CI/badge.svg)](\nhttps://github.c"
  },
  {
    "path": "crossbeam-deque/build.rs",
    "chars": 443,
    "preview": "// The rustc-cfg emitted by the build script are *not* public API.\n\nuse std::env;\n\nfn main() {\n    println!(\"cargo:rerun"
  },
  {
    "path": "crossbeam-deque/src/deque.rs",
    "chars": 74858,
    "preview": "use alloc::{alloc::handle_alloc_error, boxed::Box, sync::Arc};\nuse core::{\n    alloc::Layout,\n    cell::{Cell, UnsafeCel"
  },
  {
    "path": "crossbeam-deque/src/lib.rs",
    "chars": 4047,
    "preview": "//! Concurrent work-stealing deques.\n//!\n//! These data structures are most commonly used in work-stealing schedulers. T"
  },
  {
    "path": "crossbeam-deque/tests/fifo.rs",
    "chars": 8388,
    "preview": "use std::sync::{\n    Arc, Mutex,\n    atomic::{AtomicBool, AtomicUsize, Ordering::SeqCst},\n};\n\nuse crossbeam_deque::{\n   "
  },
  {
    "path": "crossbeam-deque/tests/injector.rs",
    "chars": 9593,
    "preview": "use std::sync::{\n    Arc, Mutex,\n    atomic::{AtomicBool, AtomicUsize, Ordering::SeqCst},\n};\n\nuse crossbeam_deque::{\n   "
  },
  {
    "path": "crossbeam-deque/tests/lifo.rs",
    "chars": 8473,
    "preview": "use std::sync::{\n    Arc, Mutex,\n    atomic::{AtomicBool, AtomicUsize, Ordering::SeqCst},\n};\n\nuse crossbeam_deque::{\n   "
  },
  {
    "path": "crossbeam-deque/tests/steal.rs",
    "chars": 4629,
    "preview": "use crossbeam_deque::{\n    Injector,\n    Steal::{self, Success},\n    Worker,\n};\n\nfn busy_retry<T>(mut f: impl FnMut() ->"
  },
  {
    "path": "crossbeam-epoch/CHANGELOG.md",
    "chars": 5439,
    "preview": "# Version 0.9.18\n\n- Remove dependency on `cfg-if`. (#1072)\n- Remove dependency on `autocfg`. (#1071)\n\n# Version 0.9.17\n\n"
  },
  {
    "path": "crossbeam-epoch/Cargo.toml",
    "chars": 2014,
    "preview": "[package]\nname = \"crossbeam-epoch\"\n# When publishing a new version:\n# - Update CHANGELOG.md\n# - Update README.md (when i"
  },
  {
    "path": "crossbeam-epoch/LICENSE-APACHE",
    "chars": 10847,
    "preview": "                              Apache License\n                        Version 2.0, January 2004\n                     http"
  },
  {
    "path": "crossbeam-epoch/LICENSE-MIT",
    "chars": 1099,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2019 The Crossbeam Project Developers\n\nPermission is hereby granted, free of charge"
  },
  {
    "path": "crossbeam-epoch/README.md",
    "chars": 2086,
    "preview": "# Crossbeam Epoch\n\n[![Build Status](https://github.com/crossbeam-rs/crossbeam/workflows/CI/badge.svg)](\nhttps://github.c"
  },
  {
    "path": "crossbeam-epoch/benches/defer.rs",
    "chars": 1537,
    "preview": "#![feature(test)]\n\nextern crate test;\n\nuse crossbeam_epoch::{self as epoch, Owned};\nuse crossbeam_utils::thread::scope;\n"
  },
  {
    "path": "crossbeam-epoch/benches/flush.rs",
    "chars": 1040,
    "preview": "#![feature(test)]\n\nextern crate test;\n\nuse std::sync::Barrier;\n\nuse crossbeam_epoch as epoch;\nuse crossbeam_utils::threa"
  },
  {
    "path": "crossbeam-epoch/benches/pin.rs",
    "chars": 575,
    "preview": "#![feature(test)]\n\nextern crate test;\n\nuse crossbeam_epoch as epoch;\nuse crossbeam_utils::thread::scope;\nuse test::Bench"
  },
  {
    "path": "crossbeam-epoch/build.rs",
    "chars": 443,
    "preview": "// The rustc-cfg emitted by the build script are *not* public API.\n\nuse std::env;\n\nfn main() {\n    println!(\"cargo:rerun"
  },
  {
    "path": "crossbeam-epoch/examples/sanitize.rs",
    "chars": 1789,
    "preview": "use std::{\n    sync::{\n        Arc,\n        atomic::{\n            AtomicUsize,\n            Ordering::{AcqRel, Acquire, R"
  },
  {
    "path": "crossbeam-epoch/src/atomic.rs",
    "chars": 55500,
    "preview": "use alloc::boxed::Box;\nuse core::{\n    alloc::Layout,\n    borrow::{Borrow, BorrowMut},\n    cmp, fmt,\n    marker::Phantom"
  },
  {
    "path": "crossbeam-epoch/src/collector.rs",
    "chars": 12194,
    "preview": "/// Epoch-based garbage collector.\n///\n/// # Examples\n///\n/// ```\n/// use crossbeam_epoch::Collector;\n///\n/// let collec"
  },
  {
    "path": "crossbeam-epoch/src/default.rs",
    "chars": 2612,
    "preview": "//! The default garbage collector.\n//!\n//! For each thread, a participant is lazily initialized on its first use, when t"
  },
  {
    "path": "crossbeam-epoch/src/deferred.rs",
    "chars": 4218,
    "preview": "use alloc::boxed::Box;\nuse core::{\n    fmt,\n    marker::PhantomData,\n    mem::{self, MaybeUninit},\n    ptr,\n};\n\n/// Numb"
  },
  {
    "path": "crossbeam-epoch/src/epoch.rs",
    "chars": 5434,
    "preview": "//! The global epoch\n//!\n//! The last bit in this number is unused and is always zero. Every so often the global epoch i"
  },
  {
    "path": "crossbeam-epoch/src/guard.rs",
    "chars": 19641,
    "preview": "use core::{fmt, mem};\n\nuse crate::{\n    atomic::{Pointable, Shared},\n    collector::Collector,\n    deferred::Deferred,\n "
  },
  {
    "path": "crossbeam-epoch/src/internal.rs",
    "chars": 22470,
    "preview": "//! The global data and participant for garbage collection.\n//!\n//! # Registration\n//!\n//! In order to track all partici"
  },
  {
    "path": "crossbeam-epoch/src/lib.rs",
    "chars": 6996,
    "preview": "//! Epoch-based memory reclamation.\n//!\n//! An interesting problem concurrent collections deal with comes from the remov"
  },
  {
    "path": "crossbeam-epoch/src/sync/list.rs",
    "chars": 16417,
    "preview": "//! Lock-free intrusive linked list.\n//!\n//! Ideas from Michael.  High Performance Dynamic Lock-Free Hash Tables and Lis"
  },
  {
    "path": "crossbeam-epoch/src/sync/mod.rs",
    "chars": 76,
    "preview": "//! Synchronization primitives.\n\npub(crate) mod list;\npub(crate) mod queue;\n"
  },
  {
    "path": "crossbeam-epoch/src/sync/queue.rs",
    "chars": 14227,
    "preview": "//! Michael-Scott lock-free queue.\n//!\n//! Usable with any number of producers and consumers.\n//!\n//! Michael and Scott."
  },
  {
    "path": "crossbeam-epoch/tests/loom.rs",
    "chars": 5232,
    "preview": "// Put in module instead of using #![cfg(..)] to work around rustc/cargo bug around -Z crate-attr.\n#[cfg(crossbeam_loom)"
  },
  {
    "path": "crossbeam-queue/CHANGELOG.md",
    "chars": 1838,
    "preview": "# Version 0.3.12\n\n- Fix stack overflow when pushing large value to `SegQueue`. (#1146, #1147, #1159)\n\n# Version 0.3.11\n\n"
  },
  {
    "path": "crossbeam-queue/Cargo.toml",
    "chars": 1415,
    "preview": "[package]\nname = \"crossbeam-queue\"\n# When publishing a new version:\n# - Update CHANGELOG.md\n# - Update README.md (when i"
  },
  {
    "path": "crossbeam-queue/LICENSE-APACHE",
    "chars": 10847,
    "preview": "                              Apache License\n                        Version 2.0, January 2004\n                     http"
  },
  {
    "path": "crossbeam-queue/LICENSE-MIT",
    "chars": 1099,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2019 The Crossbeam Project Developers\n\nPermission is hereby granted, free of charge"
  },
  {
    "path": "crossbeam-queue/README.md",
    "chars": 2123,
    "preview": "# Crossbeam Queue\n\n[![Build Status](https://github.com/crossbeam-rs/crossbeam/workflows/CI/badge.svg)](\nhttps://github.c"
  },
  {
    "path": "crossbeam-queue/src/array_queue.rs",
    "chars": 19906,
    "preview": "//! The implementation is based on Dmitry Vyukov's bounded MPMC queue.\n//!\n//! Source:\n//!   - <http://www.1024cores.net"
  },
  {
    "path": "crossbeam-queue/src/lib.rs",
    "chars": 1043,
    "preview": "//! Concurrent queues.\n//!\n//! This crate provides concurrent queues that can be shared among threads:\n//!\n//! * [`Array"
  },
  {
    "path": "crossbeam-queue/src/seg_queue.rs",
    "chars": 23511,
    "preview": "use alloc::{alloc::handle_alloc_error, boxed::Box};\nuse core::{\n    alloc::Layout,\n    cell::UnsafeCell,\n    fmt,\n    ma"
  },
  {
    "path": "crossbeam-queue/tests/array_queue.rs",
    "chars": 8820,
    "preview": "use std::sync::atomic::{AtomicUsize, Ordering};\n\nuse crossbeam_queue::ArrayQueue;\nuse crossbeam_utils::thread::scope;\n\n#"
  },
  {
    "path": "crossbeam-queue/tests/seg_queue.rs",
    "chars": 5178,
    "preview": "use std::sync::atomic::{AtomicUsize, Ordering};\n\nuse crossbeam_queue::SegQueue;\nuse crossbeam_utils::thread::scope;\n\n#[t"
  },
  {
    "path": "crossbeam-skiplist/CHANGELOG.md",
    "chars": 492,
    "preview": "# Version 0.1.3\n\n- Remove dependency on `cfg-if`. (#1072)\n\n# Version 0.1.2\n\n- Bump the minimum supported Rust version to"
  },
  {
    "path": "crossbeam-skiplist/Cargo.toml",
    "chars": 1595,
    "preview": "[package]\nname = \"crossbeam-skiplist\"\n# When publishing a new version:\n# - Update CHANGELOG.md\n# - Update README.md (whe"
  },
  {
    "path": "crossbeam-skiplist/LICENSE-APACHE",
    "chars": 10847,
    "preview": "                              Apache License\n                        Version 2.0, January 2004\n                     http"
  },
  {
    "path": "crossbeam-skiplist/LICENSE-MIT",
    "chars": 1099,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2019 The Crossbeam Project Developers\n\nPermission is hereby granted, free of charge"
  },
  {
    "path": "crossbeam-skiplist/README.md",
    "chars": 2161,
    "preview": "# Crossbeam Skiplist\n\n[![Build Status](https://github.com/crossbeam-rs/crossbeam/workflows/CI/badge.svg)](\nhttps://githu"
  },
  {
    "path": "crossbeam-skiplist/benches/btree.rs",
    "chars": 1820,
    "preview": "#![feature(test)]\n\nextern crate test;\n\nuse std::collections::BTreeMap as Map;\n\nuse test::{Bencher, black_box};\n\n#[bench]"
  },
  {
    "path": "crossbeam-skiplist/benches/hash.rs",
    "chars": 1509,
    "preview": "#![feature(test)]\n\nextern crate test;\n\nuse std::collections::HashMap as Map;\n\nuse test::{Bencher, black_box};\n\n#[bench]\n"
  },
  {
    "path": "crossbeam-skiplist/benches/skiplist.rs",
    "chars": 2349,
    "preview": "#![feature(test)]\n#![allow(clippy::unit_arg)]\n\nextern crate test;\n\nuse crossbeam_epoch as epoch;\nuse crossbeam_skiplist:"
  },
  {
    "path": "crossbeam-skiplist/benches/skipmap.rs",
    "chars": 1800,
    "preview": "#![feature(test)]\n\nextern crate test;\n\nuse crossbeam_skiplist::SkipMap as Map;\nuse test::{Bencher, black_box};\n\n#[bench]"
  },
  {
    "path": "crossbeam-skiplist/examples/simple.rs",
    "chars": 771,
    "preview": "// use std::time::Instant;\n\nfn main() {\n    // let map = crossbeam_skiplist::SkipMap::new();\n    // // let mut map = std"
  },
  {
    "path": "crossbeam-skiplist/src/base.rs",
    "chars": 79755,
    "preview": "//! A lock-free skip list. See [`SkipList`].\n\nuse alloc::alloc::handle_alloc_error;\nuse core::{\n    alloc::Layout,\n    c"
  },
  {
    "path": "crossbeam-skiplist/src/comparator.rs",
    "chars": 3408,
    "preview": "//! Traits for key comparison in maps.\n\nuse core::cmp::Ordering;\n\nuse crate::equivalent::{Comparable, Equivalent};\n\n/// "
  },
  {
    "path": "crossbeam-skiplist/src/equivalent.rs",
    "chars": 1606,
    "preview": "// These traits are based on `equivalent` crate, but `K` and `Q` are flipped to avoid type inference issues:\n// https://"
  },
  {
    "path": "crossbeam-skiplist/src/lib.rs",
    "chars": 10163,
    "preview": "//! Concurrent maps and sets based on [skip lists].\n//!\n//! This crate provides the types [`SkipMap`] and [`SkipSet`].\n/"
  },
  {
    "path": "crossbeam-skiplist/src/map.rs",
    "chars": 23070,
    "preview": "//! An ordered map based on a lock-free skip list. See [`SkipMap`].\n\nuse core::{\n    fmt,\n    mem::ManuallyDrop,\n    ops"
  },
  {
    "path": "crossbeam-skiplist/src/set.rs",
    "chars": 16068,
    "preview": "//! A set based on a lock-free skip list. See [`SkipSet`].\n\nuse core::{\n    fmt,\n    ops::{Bound, Deref, RangeBounds},\n}"
  },
  {
    "path": "crossbeam-skiplist/tests/base.rs",
    "chars": 28532,
    "preview": "#![allow(clippy::redundant_clone)]\n\nuse std::{\n    ops::Bound,\n    sync::atomic::{AtomicUsize, Ordering},\n};\n\nuse crossb"
  },
  {
    "path": "crossbeam-skiplist/tests/map.rs",
    "chars": 26803,
    "preview": "use std::{\n    borrow::Borrow,\n    iter,\n    ops::Bound,\n    sync::{Arc, Barrier},\n};\n\nuse crossbeam_skiplist::SkipMap;\n"
  },
  {
    "path": "crossbeam-skiplist/tests/set.rs",
    "chars": 19847,
    "preview": "use std::{\n    iter,\n    ops::Bound,\n    sync::{Arc, Barrier},\n};\n\nuse crossbeam_skiplist::SkipSet;\nuse crossbeam_utils:"
  },
  {
    "path": "crossbeam-utils/CHANGELOG.md",
    "chars": 7509,
    "preview": "# Version 0.8.21\n\n- Improve implementation of `CachePadded`. (#1152)\n\n# Version 0.8.20\n\n- Implement `Display` for `Cache"
  },
  {
    "path": "crossbeam-utils/Cargo.toml",
    "chars": 1580,
    "preview": "[package]\nname = \"crossbeam-utils\"\n# When publishing a new version:\n# - Update CHANGELOG.md\n# - Update README.md (when i"
  },
  {
    "path": "crossbeam-utils/LICENSE-APACHE",
    "chars": 10847,
    "preview": "                              Apache License\n                        Version 2.0, January 2004\n                     http"
  },
  {
    "path": "crossbeam-utils/LICENSE-MIT",
    "chars": 1099,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2019 The Crossbeam Project Developers\n\nPermission is hereby granted, free of charge"
  },
  {
    "path": "crossbeam-utils/README.md",
    "chars": 3187,
    "preview": "# Crossbeam Utils\n\n[![Build Status](https://github.com/crossbeam-rs/crossbeam/workflows/CI/badge.svg)](\nhttps://github.c"
  },
  {
    "path": "crossbeam-utils/benches/atomic_cell.rs",
    "chars": 3369,
    "preview": "#![feature(test)]\n\nextern crate test;\n\nuse std::sync::Barrier;\n\nuse crossbeam_utils::{atomic::AtomicCell, thread};\n\n#[be"
  },
  {
    "path": "crossbeam-utils/build.rs",
    "chars": 1812,
    "preview": "// The rustc-cfg listed below are considered public API, but it is *unstable*\n// and outside of the normal semver guaran"
  },
  {
    "path": "crossbeam-utils/src/alloc_helper.rs",
    "chars": 3458,
    "preview": "use core::{alloc::Layout, ptr::NonNull};\n\n// Based on unstable alloc::alloc::Global.\n//\n// Note: unlike alloc::alloc::Gl"
  },
  {
    "path": "crossbeam-utils/src/atomic/atomic_cell.rs",
    "chars": 39223,
    "preview": "// Necessary for implementing atomic methods for `AtomicUnit`\n#![allow(clippy::unit_arg)]\n\nuse core::{\n    cell::UnsafeC"
  },
  {
    "path": "crossbeam-utils/src/atomic/consume.rs",
    "chars": 3736,
    "preview": "#[cfg(not(crossbeam_no_atomic))]\nuse core::sync::atomic::Ordering;\n\n/// Trait which allows reading from primitive atomic"
  },
  {
    "path": "crossbeam-utils/src/atomic/mod.rs",
    "chars": 1319,
    "preview": "//! Atomic types.\n//!\n//! * [`AtomicCell`], a thread-safe mutable memory location.\n//! * [`AtomicConsume`], for reading "
  },
  {
    "path": "crossbeam-utils/src/atomic/seq_lock.rs",
    "chars": 2958,
    "preview": "use core::{\n    mem,\n    sync::atomic::{self, AtomicUsize, Ordering},\n};\n\nuse crate::Backoff;\n\n/// A simple stamped lock"
  },
  {
    "path": "crossbeam-utils/src/atomic/seq_lock_wide.rs",
    "chars": 5392,
    "preview": "use core::{\n    mem,\n    sync::atomic::{self, AtomicUsize, Ordering},\n};\n\nuse crate::Backoff;\n\n/// A simple stamped lock"
  },
  {
    "path": "crossbeam-utils/src/backoff.rs",
    "chars": 8271,
    "preview": "use core::{cell::Cell, fmt};\n\nuse crate::primitive::hint;\n\nconst SPIN_LIMIT: u32 = 6;\nconst YIELD_LIMIT: u32 = 10;\n\n/// "
  },
  {
    "path": "crossbeam-utils/src/cache_padded.rs",
    "chars": 7537,
    "preview": "use core::{\n    fmt,\n    ops::{Deref, DerefMut},\n};\n\n/// Pads and aligns a value to the length of a cache line.\n///\n/// "
  },
  {
    "path": "crossbeam-utils/src/lib.rs",
    "chars": 2997,
    "preview": "//! Miscellaneous tools for concurrent programming.\n//!\n//! ## Atomics\n//!\n//! * [`AtomicCell`], a thread-safe mutable m"
  },
  {
    "path": "crossbeam-utils/src/sync/mod.rs",
    "chars": 577,
    "preview": "//! Thread synchronization primitives.\n//!\n//! * [`Parker`], a thread parking primitive.\n//! * [`ShardedLock`], a sharde"
  },
  {
    "path": "crossbeam-utils/src/sync/once_lock.rs",
    "chars": 2656,
    "preview": "// Based on unstable std::sync::OnceLock.\n//\n// Source: https://github.com/rust-lang/rust/blob/8e9c93df464b7ada3fc7a1c8c"
  },
  {
    "path": "crossbeam-utils/src/sync/parker.rs",
    "chars": 13624,
    "preview": "use core::{fmt, marker::PhantomData, time::Duration};\nuse std::time::Instant;\n\nuse crate::primitive::sync::{\n    Arc, Co"
  },
  {
    "path": "crossbeam-utils/src/sync/sharded_lock.rs",
    "chars": 20533,
    "preview": "use alloc::{boxed::Box, vec::Vec};\nuse core::{\n    cell::UnsafeCell,\n    fmt,\n    marker::PhantomData,\n    mem,\n    ops:"
  },
  {
    "path": "crossbeam-utils/src/sync/wait_group.rs",
    "chars": 4459,
    "preview": "use core::{fmt, mem::ManuallyDrop};\n\nuse crate::primitive::sync::{\n    Arc, Condvar, Mutex,\n    atomic::{AtomicUsize, Or"
  },
  {
    "path": "crossbeam-utils/src/thread.rs",
    "chars": 19933,
    "preview": "//! Threads that can borrow variables from the stack.\n//!\n//! Create a scope when spawned threads need to access variabl"
  },
  {
    "path": "crossbeam-utils/tests/atomic_cell.rs",
    "chars": 10750,
    "preview": "use std::{\n    mem,\n    sync::atomic::{AtomicUsize, Ordering::SeqCst},\n};\n\nuse crossbeam_utils::atomic::AtomicCell;\n\n// "
  },
  {
    "path": "crossbeam-utils/tests/cache_padded.rs",
    "chars": 2322,
    "preview": "use std::{cell::Cell, mem};\n\nuse crossbeam_utils::CachePadded;\n\n#[test]\nfn default() {\n    let x: CachePadded<u64> = Def"
  },
  {
    "path": "crossbeam-utils/tests/parker.rs",
    "chars": 1102,
    "preview": "use std::{thread::sleep, time::Duration};\n\nuse crossbeam_utils::{\n    sync::{Parker, UnparkReason},\n    thread,\n};\n\n#[te"
  },
  {
    "path": "crossbeam-utils/tests/sharded_lock.rs",
    "chars": 6241,
    "preview": "use std::{\n    sync::{\n        Arc, TryLockError,\n        atomic::{AtomicUsize, Ordering},\n        mpsc::channel,\n    },"
  },
  {
    "path": "crossbeam-utils/tests/thread.rs",
    "chars": 5117,
    "preview": "use std::{\n    any::Any,\n    sync::atomic::{AtomicUsize, Ordering},\n    thread::sleep,\n    time::Duration,\n};\n\nuse cross"
  },
  {
    "path": "crossbeam-utils/tests/wait_group.rs",
    "chars": 1443,
    "preview": "use std::{sync::mpsc, thread, time::Duration};\n\nuse crossbeam_utils::sync::WaitGroup;\n\nconst THREADS: usize = 10;\n\n#[tes"
  },
  {
    "path": "no_atomic.rs",
    "chars": 320,
    "preview": "// This file is @generated by no_atomic.sh.\n// It is not intended for manual editing.\n\nconst NO_ATOMIC: &[&str] = &[\n   "
  },
  {
    "path": "src/lib.rs",
    "chars": 2488,
    "preview": "//! Tools for concurrent programming.\n//!\n//! ## Atomics\n//!\n//! * [`AtomicCell`], a thread-safe mutable memory location"
  },
  {
    "path": "tests/subcrates.rs",
    "chars": 785,
    "preview": "//! Makes sure subcrates are properly re-exported.\n\nuse crossbeam::select;\n\n#[test]\nfn channel() {\n    let (s, r) = cros"
  },
  {
    "path": "tools/publish.sh",
    "chars": 966,
    "preview": "#!/bin/bash\nset -euo pipefail\nIFS=$'\\n\\t'\ncd \"$(dirname \"$0\")\"/..\n\n# Publish a new release.\n#\n# USAGE:\n#    ./tools/publ"
  }
]

About this extraction

This page contains the full source code of the crossbeam-rs/crossbeam GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 176 files (1.5 MB), approximately 383.3k tokens, and a symbol index with 2166 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!