Vendor things
This commit is contained in:
parent
5deceec006
commit
977e3c17e5
19434 changed files with 10682014 additions and 0 deletions
1
third-party/vendor/crossbeam/.cargo-checksum.json
vendored
Normal file
1
third-party/vendor/crossbeam/.cargo-checksum.json
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"files":{"CHANGELOG.md":"87ba1b0829aea990ab3d7f2a30899c9d5e1067fba07c2abefae1fd004f2a5982","Cargo.toml":"9411d90fcc5e6badf13c9b3c133f2330b2b900dc4c851cfea36b8035cad7ca40","LICENSE-APACHE":"6f712474a3e3be1386d2d0c29449850ea788da64d35cff0fc8799acf741e9ecd","LICENSE-MIT":"5734ed989dfca1f625b40281ee9f4530f91b2411ec01cb748223e7eb87e201ab","README.md":"dbe15407a26bdae7ecdcb376b8c62170104156f12c3c1ed8b121e9d6e763d63b","build-common.rs":"502cb7494549bed6fa10ac7bea36e880eeb60290dc69b679ac5c92b376469562","no_atomic.rs":"31a8276afd38e39987a169eeb02e9bed32670de5ca36d7eb74aab7e506cf9dc4","src/lib.rs":"27e0ffe5571c303464e8e30b6e2d486ccb342cb4293d49f282666e1f63fc39cc","tests/subcrates.rs":"bb9715e661d65bf9e61d41ad838f09dc531d624e705ab8650e1ee549a1e1feaf"},"package":"1137cd7e7fc0fb5d3c5a8678be38ec56e819125d8d7907411fe24ccb943faca8"}
|
||||
105
third-party/vendor/crossbeam/CHANGELOG.md
vendored
Normal file
105
third-party/vendor/crossbeam/CHANGELOG.md
vendored
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
# 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
|
||||
86
third-party/vendor/crossbeam/Cargo.toml
vendored
Normal file
86
third-party/vendor/crossbeam/Cargo.toml
vendored
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
|
||||
#
|
||||
# When uploading crates to the registry Cargo will automatically
|
||||
# "normalize" Cargo.toml files for maximal compatibility
|
||||
# with all versions of Cargo and also rewrite `path` dependencies
|
||||
# to registry (e.g., crates.io) dependencies.
|
||||
#
|
||||
# If you are reading this file be aware that the original Cargo.toml
|
||||
# will likely look very different (and much more reasonable).
|
||||
# See Cargo.toml.orig for the original contents.
|
||||
|
||||
[package]
|
||||
edition = "2021"
|
||||
rust-version = "1.61"
|
||||
name = "crossbeam"
|
||||
version = "0.8.4"
|
||||
exclude = [
|
||||
"/.*",
|
||||
"/ci",
|
||||
"/tools",
|
||||
]
|
||||
description = "Tools for concurrent programming"
|
||||
homepage = "https://github.com/crossbeam-rs/crossbeam"
|
||||
readme = "README.md"
|
||||
keywords = [
|
||||
"atomic",
|
||||
"garbage",
|
||||
"non-blocking",
|
||||
"lock-free",
|
||||
"rcu",
|
||||
]
|
||||
categories = [
|
||||
"concurrency",
|
||||
"memory-management",
|
||||
"data-structures",
|
||||
"no-std",
|
||||
]
|
||||
license = "MIT OR Apache-2.0"
|
||||
repository = "https://github.com/crossbeam-rs/crossbeam"
|
||||
|
||||
[dependencies.crossbeam-channel]
|
||||
version = "0.5.10"
|
||||
optional = true
|
||||
default-features = false
|
||||
|
||||
[dependencies.crossbeam-deque]
|
||||
version = "0.8.4"
|
||||
optional = true
|
||||
default-features = false
|
||||
|
||||
[dependencies.crossbeam-epoch]
|
||||
version = "0.9.17"
|
||||
optional = true
|
||||
default-features = false
|
||||
|
||||
[dependencies.crossbeam-queue]
|
||||
version = "0.3.10"
|
||||
optional = true
|
||||
default-features = false
|
||||
|
||||
[dependencies.crossbeam-utils]
|
||||
version = "0.8.18"
|
||||
default-features = false
|
||||
|
||||
[dev-dependencies.rand]
|
||||
version = "0.8"
|
||||
|
||||
[features]
|
||||
alloc = [
|
||||
"crossbeam-epoch/alloc",
|
||||
"crossbeam-queue/alloc",
|
||||
]
|
||||
default = ["std"]
|
||||
nightly = [
|
||||
"crossbeam-epoch/nightly",
|
||||
"crossbeam-utils/nightly",
|
||||
"crossbeam-queue/nightly",
|
||||
]
|
||||
std = [
|
||||
"alloc",
|
||||
"crossbeam-channel/std",
|
||||
"crossbeam-deque/std",
|
||||
"crossbeam-epoch/std",
|
||||
"crossbeam-queue/std",
|
||||
"crossbeam-utils/std",
|
||||
]
|
||||
201
third-party/vendor/crossbeam/LICENSE-APACHE
vendored
Normal file
201
third-party/vendor/crossbeam/LICENSE-APACHE
vendored
Normal file
|
|
@ -0,0 +1,201 @@
|
|||
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.
|
||||
27
third-party/vendor/crossbeam/LICENSE-MIT
vendored
Normal file
27
third-party/vendor/crossbeam/LICENSE-MIT
vendored
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
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.
|
||||
158
third-party/vendor/crossbeam/README.md
vendored
Normal file
158
third-party/vendor/crossbeam/README.md
vendored
Normal file
|
|
@ -0,0 +1,158 @@
|
|||
# Crossbeam
|
||||
|
||||
[](
|
||||
https://github.com/crossbeam-rs/crossbeam/actions)
|
||||
[](
|
||||
https://github.com/crossbeam-rs/crossbeam#license)
|
||||
[](
|
||||
https://crates.io/crates/crossbeam)
|
||||
[](
|
||||
https://docs.rs/crossbeam)
|
||||
[](
|
||||
https://www.rust-lang.org)
|
||||
[](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/*/crossbeam/atomic/struct.AtomicCell.html
|
||||
[`AtomicConsume`]: https://docs.rs/crossbeam/*/crossbeam/atomic/trait.AtomicConsume.html
|
||||
[`deque`]: https://docs.rs/crossbeam/*/crossbeam/deque/index.html
|
||||
[`ArrayQueue`]: https://docs.rs/crossbeam/*/crossbeam/queue/struct.ArrayQueue.html
|
||||
[`SegQueue`]: https://docs.rs/crossbeam/*/crossbeam/queue/struct.SegQueue.html
|
||||
[`channel`]: https://docs.rs/crossbeam/*/crossbeam/channel/index.html
|
||||
[`Parker`]: https://docs.rs/crossbeam/*/crossbeam/sync/struct.Parker.html
|
||||
[`ShardedLock`]: https://docs.rs/crossbeam/*/crossbeam/sync/struct.ShardedLock.html
|
||||
[`WaitGroup`]: https://docs.rs/crossbeam/*/crossbeam/sync/struct.WaitGroup.html
|
||||
[`epoch`]: https://docs.rs/crossbeam/*/crossbeam/epoch/index.html
|
||||
[`Backoff`]: https://docs.rs/crossbeam/*/crossbeam/utils/struct.Backoff.html
|
||||
[`CachePadded`]: https://docs.rs/crossbeam/*/crossbeam/utils/struct.CachePadded.html
|
||||
[`scope`]: https://docs.rs/crossbeam/*/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.61.
|
||||
|
||||
## 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.
|
||||
13
third-party/vendor/crossbeam/build-common.rs
vendored
Normal file
13
third-party/vendor/crossbeam/build-common.rs
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// 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("-")
|
||||
}
|
||||
12
third-party/vendor/crossbeam/no_atomic.rs
vendored
Normal file
12
third-party/vendor/crossbeam/no_atomic.rs
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
// This file is @generated by no_atomic.sh.
|
||||
// It is not intended for manual editing.
|
||||
|
||||
const NO_ATOMIC: &[&str] = &[
|
||||
"bpfeb-unknown-none",
|
||||
"bpfel-unknown-none",
|
||||
"mipsel-sony-psx",
|
||||
"msp430-none-elf",
|
||||
"riscv32i-unknown-none-elf",
|
||||
"riscv32im-unknown-none-elf",
|
||||
"riscv32imc-unknown-none-elf",
|
||||
];
|
||||
81
third-party/vendor/crossbeam/src/lib.rs
vendored
Normal file
81
third-party/vendor/crossbeam/src/lib.rs
vendored
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
//! Tools for concurrent programming.
|
||||
//!
|
||||
//! ## Atomics
|
||||
//!
|
||||
//! * [`AtomicCell`], a thread-safe mutable memory location.
|
||||
//! * [`AtomicConsume`], for reading from primitive atomic types with "consume" ordering.
|
||||
//!
|
||||
//! ## Data structures
|
||||
//!
|
||||
//! * [`deque`], work-stealing deques for building task schedulers.
|
||||
//! * [`ArrayQueue`], a bounded MPMC queue that allocates a fixed-capacity buffer on construction.
|
||||
//! * [`SegQueue`], an unbounded MPMC queue that allocates small buffers, segments, on demand.
|
||||
//!
|
||||
//! ## Memory management
|
||||
//!
|
||||
//! * [`epoch`], an epoch-based garbage collector.
|
||||
//!
|
||||
//! ## 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.
|
||||
//! * [`CachePadded`], for padding and aligning a value to the length of a cache line.
|
||||
//! * [`scope`], for spawning threads that borrow local variables from the stack.
|
||||
//!
|
||||
//! [`AtomicCell`]: atomic::AtomicCell
|
||||
//! [`AtomicConsume`]: atomic::AtomicConsume
|
||||
//! [`ArrayQueue`]: queue::ArrayQueue
|
||||
//! [`SegQueue`]: queue::SegQueue
|
||||
//! [`Parker`]: sync::Parker
|
||||
//! [`ShardedLock`]: sync::ShardedLock
|
||||
//! [`WaitGroup`]: sync::WaitGroup
|
||||
//! [`Backoff`]: utils::Backoff
|
||||
//! [`CachePadded`]: utils::CachePadded
|
||||
|
||||
#![doc(test(
|
||||
no_crate_inject,
|
||||
attr(
|
||||
deny(warnings, rust_2018_idioms),
|
||||
allow(dead_code, unused_assignments, unused_variables)
|
||||
)
|
||||
))]
|
||||
#![warn(
|
||||
missing_docs,
|
||||
missing_debug_implementations,
|
||||
rust_2018_idioms,
|
||||
unreachable_pub
|
||||
)]
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
pub use crossbeam_utils::atomic;
|
||||
|
||||
pub mod utils {
|
||||
//! Miscellaneous utilities.
|
||||
//!
|
||||
//! * [`Backoff`], for exponential backoff in spin loops.
|
||||
//! * [`CachePadded`], for padding and aligning a value to the length of a cache line.
|
||||
|
||||
pub use crossbeam_utils::Backoff;
|
||||
pub use crossbeam_utils::CachePadded;
|
||||
}
|
||||
|
||||
#[cfg(feature = "alloc")]
|
||||
#[doc(inline)]
|
||||
pub use {crossbeam_epoch as epoch, crossbeam_queue as queue};
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
#[doc(inline)]
|
||||
pub use {
|
||||
crossbeam_channel as channel, crossbeam_channel::select, crossbeam_deque as deque,
|
||||
crossbeam_utils::sync,
|
||||
};
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
#[cfg(not(crossbeam_loom))]
|
||||
pub use crossbeam_utils::thread::{self, scope};
|
||||
48
third-party/vendor/crossbeam/tests/subcrates.rs
vendored
Normal file
48
third-party/vendor/crossbeam/tests/subcrates.rs
vendored
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
//! Makes sure subcrates are properly re-exported.
|
||||
|
||||
use crossbeam::select;
|
||||
|
||||
#[test]
|
||||
fn channel() {
|
||||
let (s, r) = crossbeam::channel::bounded(1);
|
||||
|
||||
select! {
|
||||
send(s, 0) -> res => res.unwrap(),
|
||||
recv(r) -> res => assert!(res.is_ok()),
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn deque() {
|
||||
let w = crossbeam::deque::Worker::new_fifo();
|
||||
w.push(1);
|
||||
let _ = w.pop();
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(miri, ignore)] // Miri ICE: https://github.com/crossbeam-rs/crossbeam/pull/870#issuecomment-1189209073
|
||||
fn epoch() {
|
||||
crossbeam::epoch::pin();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn queue() {
|
||||
let a = crossbeam::queue::ArrayQueue::new(10);
|
||||
let _ = a.push(1);
|
||||
let _ = a.pop();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn utils() {
|
||||
crossbeam::utils::CachePadded::new(7);
|
||||
|
||||
crossbeam::scope(|scope| {
|
||||
scope.spawn(|_| ());
|
||||
})
|
||||
.unwrap();
|
||||
|
||||
crossbeam::thread::scope(|scope| {
|
||||
scope.spawn(|_| ());
|
||||
})
|
||||
.unwrap();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue