Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce tokio-sync crate containing synchronization primitives. #839

Merged
merged 57 commits into from
Jan 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
3dee276
Initial tokio-sync commit
carllerche Dec 18, 2018
b57b9f4
Restructure semaphore a bit
carllerche Dec 18, 2018
a96473a
Tweak API
carllerche Dec 18, 2018
dd5c1a6
Pass loom
carllerche Dec 18, 2018
3143b78
Misc tweaks
carllerche Dec 21, 2018
ce27fc3
Work on mpsc
carllerche Dec 23, 2018
a5f7327
WIP
carllerche Dec 26, 2018
cb833c7
WIP Semaphore close
carllerche Dec 27, 2018
7b4af6e
WIP semaphore close
carllerche Dec 27, 2018
fed0e05
More semaphore work
carllerche Dec 27, 2018
9f7c7f4
Start on close
carllerche Dec 27, 2018
4a5ee23
Fix mpsc test
carllerche Dec 27, 2018
88da975
More tests
carllerche Dec 27, 2018
c0ae003
More tests
carllerche Dec 27, 2018
50f420f
Cleanup
carllerche Dec 27, 2018
20f03f9
Much more progress
carllerche Dec 28, 2018
5bb3547
Refine error
carllerche Dec 28, 2018
570eea2
Unbounded channel
carllerche Dec 28, 2018
9b4fbff
Clear channel on drop
carllerche Dec 28, 2018
8e9d766
Start oneshot
carllerche Dec 30, 2018
3d6cc0e
Simplify oneshot some
carllerche Dec 30, 2018
9cb278b
Oneshot cancellation
carllerche Jan 1, 2019
d493d38
More oneshot work
carllerche Jan 2, 2019
b532577
Track loom changes
carllerche Jan 3, 2019
3b73c2d
Depend on loom from git
carllerche Jan 3, 2019
a5f91cc
Merge remote-tracking branch 'origin/master' into tokio-sync
carllerche Jan 3, 2019
9dabff3
Allow CI to finish
carllerche Jan 4, 2019
4e7d607
Merge remote-tracking branch 'origin/master' into tokio-sync
carllerche Jan 4, 2019
34203f5
Fix Cargo.toml
carllerche Jan 4, 2019
c196cbc
Fix build on older Rust versions
carllerche Jan 4, 2019
136897c
Remove tokio-channel
carllerche Jan 4, 2019
4b39daa
Merge remote-tracking branch 'origin/master' into tokio-sync
carllerche Jan 6, 2019
84842ad
Merge remote-tracking branch 'origin/master' into tokio-sync
carllerche Jan 7, 2019
4782ff6
Merge remote-tracking branch 'origin/master' into tokio-sync
carllerche Jan 7, 2019
24ddf60
Fix bugs, get tests passing
carllerche Jan 7, 2019
1d0aab6
Remove generator feature flag
carllerche Jan 7, 2019
d4d9b73
Limit loom execution time on appveyor
carllerche Jan 8, 2019
c5011b9
Use released loom
carllerche Jan 9, 2019
9758528
API docs
carllerche Jan 9, 2019
45b9502
oneshot: implement task switching
carllerche Jan 9, 2019
c65d97e
Refine errors
carllerche Jan 9, 2019
13693d0
Add Debug impls
carllerche Jan 9, 2019
030bdbd
Docs
carllerche Jan 9, 2019
a6d1b94
Merge remote-tracking branch 'origin/master' into tokio-sync
carllerche Jan 9, 2019
4a0b629
Re-export from `tokio` crate
carllerche Jan 9, 2019
3423212
Add a doc test
carllerche Jan 9, 2019
bdca89e
Fix doc references
carllerche Jan 9, 2019
49e4072
Fix RecvError
carllerche Jan 10, 2019
73029e2
Fix tests
carllerche Jan 10, 2019
a61ae10
Fix benches
carllerche Jan 10, 2019
9d868f9
Merge remote-tracking branch 'origin/master' into tokio-sync
carllerche Jan 10, 2019
0705c5b
Deny unreachable_pub
carllerche Jan 11, 2019
eed6d2d
Oneshot errors should not have pub fields
carllerche Jan 11, 2019
734c4ae
Apply feedback
carllerche Jan 14, 2019
6373d1e
Merge remote-tracking branch 'origin/master' into tokio-sync
carllerche Jan 15, 2019
098e54a
Cleanup match statement with ?
carllerche Jan 15, 2019
e404071
Rename oneshot::Sender::poll_cancel -> poll_close
carllerche Jan 15, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .appveyor.yml
Expand Up @@ -11,6 +11,7 @@ install:
- rustup-init.exe -y --default-host %TARGET%
- set PATH=%PATH%;C:\Users\appveyor\.cargo\bin
- set RUST_BACKTRACE=1
- set LOOM_MAX_DURATION=10

- rustc -V
- cargo -V
Expand Down
2 changes: 2 additions & 0 deletions .travis.yml
Expand Up @@ -101,6 +101,8 @@ script: |
cargo check --all --exclude tokio-tls --target $TARGET
cargo check --tests --all --exclude tokio-tls --target $TARGET
else
# Limit the execution time of loom tests.
export LOOM_MAX_DURATION=10
carllerche marked this conversation as resolved.
Show resolved Hide resolved
cargo test --all --no-fail-fast
cargo doc --all
fi
Expand Down
5 changes: 4 additions & 1 deletion Cargo.toml
Expand Up @@ -26,14 +26,14 @@ members = [
"./",
"tokio-async-await",
"tokio-buf",
"tokio-channel",
"tokio-codec",
"tokio-current-thread",
"tokio-executor",
"tokio-fs",
"tokio-io",
"tokio-reactor",
"tokio-signal",
"tokio-sync",
"tokio-threadpool",
"tokio-timer",
"tokio-tcp",
Expand All @@ -49,6 +49,7 @@ default = [
"io",
"reactor",
"rt-full",
"sync",
"tcp",
"timer",
"udp",
Expand All @@ -67,6 +68,7 @@ rt-full = [
"tokio-executor",
"tokio-threadpool",
]
sync = ["tokio-sync"]
tcp = ["tokio-tcp"]
timer = ["tokio-timer"]
udp = ["tokio-udp"]
Expand Down Expand Up @@ -95,6 +97,7 @@ tokio-fs = { version = "0.1.3", path = "tokio-fs", optional = true }
tokio-io = { version = "0.1.6", path = "tokio-io", optional = true }
tokio-executor = { version = "0.1.5", path = "tokio-executor", optional = true }
tokio-reactor = { version = "0.1.1", path = "tokio-reactor", optional = true }
tokio-sync = { version = "0.1.0", path = "tokio-sync", optional = true }
tokio-threadpool = { version = "0.1.8", path = "tokio-threadpool", optional = true }
tokio-tcp = { version = "0.1.0", path = "tokio-tcp", optional = true }
tokio-udp = { version = "0.1.0", path = "tokio-udp", optional = true }
Expand Down
4 changes: 4 additions & 0 deletions src/lib.rs
Expand Up @@ -100,6 +100,8 @@ extern crate tokio_fs;
extern crate tokio_reactor;
#[cfg(feature = "rt-full")]
extern crate tokio_threadpool;
#[cfg(feature = "sync")]
extern crate tokio_sync;
#[cfg(feature = "timer")]
extern crate tokio_timer;
#[cfg(feature = "tcp")]
Expand All @@ -126,6 +128,8 @@ pub mod net;
pub mod prelude;
#[cfg(feature = "reactor")]
pub mod reactor;
#[cfg(feature = "sync")]
pub mod sync;
#[cfg(feature = "timer")]
pub mod timer;
pub mod util;
Expand Down
16 changes: 16 additions & 0 deletions src/sync.rs
@@ -0,0 +1,16 @@
//! Future-aware synchronization
//!
//! This module is enabled with the **`sync`** feature flag.
//!
//! Tasks sometimes need to communicate with each other. This module contains
//! two basic abstractions for doing so:
//!
//! - [oneshot](oneshot/index.html), a way of sending a single value
//! from one task to another.
//! - [mpsc](mpsc/index.html), a multi-producer, single-consumer channel for
//! sending values between tasks.

pub use tokio_sync::{
mpsc,
oneshot,
};
51 changes: 0 additions & 51 deletions tokio-channel/LICENSE

This file was deleted.

14 changes: 0 additions & 14 deletions tokio-channel/src/lib.rs

This file was deleted.

105 changes: 0 additions & 105 deletions tokio-channel/src/lock.rs

This file was deleted.