From 940f2c34311f9b6950360461634e36950c6da228 Mon Sep 17 00:00:00 2001 From: Lucio Franco Date: Thu, 30 May 2019 14:33:55 -0400 Subject: [PATCH 1/5] Update tokio-trace-core to 0.2 (#1111) Also includes 1b498e8aa23b53528a5a2d6e6aad2fe41f37ff60 --- ci/azure-cross-compile.yml | 3 +++ tokio-tcp/Cargo.toml | 1 + tokio-tcp/tests/tcp.rs | 7 +++++-- tokio/Cargo.toml | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ci/azure-cross-compile.yml b/ci/azure-cross-compile.yml index 857aeb94420..8c2553c726d 100644 --- a/ci/azure-cross-compile.yml +++ b/ci/azure-cross-compile.yml @@ -8,6 +8,9 @@ jobs: parameters: rust_version: stable + - script: sudo apt-get update + displayName: "apt-get update" + - script: sudo apt-get install gcc-multilib displayName: "Install gcc-multilib" diff --git a/tokio-tcp/Cargo.toml b/tokio-tcp/Cargo.toml index 8a27250f7bc..cae0f5e5de8 100644 --- a/tokio-tcp/Cargo.toml +++ b/tokio-tcp/Cargo.toml @@ -29,4 +29,5 @@ futures = "0.1.19" [dev-dependencies] env_logger = { version = "0.5", default-features = false } +net2 = "0.2" tokio = "0.1.13" diff --git a/tokio-tcp/tests/tcp.rs b/tokio-tcp/tests/tcp.rs index 0c1aca9bafd..09b4478e201 100644 --- a/tokio-tcp/tests/tcp.rs +++ b/tokio-tcp/tests/tcp.rs @@ -1,6 +1,7 @@ extern crate env_logger; extern crate futures; extern crate mio; +extern crate net2; extern crate tokio_io; extern crate tokio_tcp; @@ -84,13 +85,14 @@ fn accept2() { t.join().unwrap(); } -#[cfg(unix)] -mod unix { +#[cfg(target_os = "linux")] +mod linux { use tokio_tcp::TcpStream; use env_logger; use futures::{future, Future}; use mio::unix::UnixReady; + use net2::TcpStreamExt; use tokio_io::AsyncRead; use std::io::Write; @@ -105,6 +107,7 @@ mod unix { let addr = t!(srv.local_addr()); let t = thread::spawn(move || { let mut client = t!(srv.accept()).0; + client.set_linger(Some(Duration::from_millis(0))).unwrap(); client.write(b"hello world").unwrap(); thread::sleep(Duration::from_millis(200)); }); diff --git a/tokio/Cargo.toml b/tokio/Cargo.toml index 33d3f3d2815..66f437e7a3c 100644 --- a/tokio/Cargo.toml +++ b/tokio/Cargo.toml @@ -73,7 +73,7 @@ tokio-threadpool = { version = "0.1.14", optional = true } tokio-tcp = { version = "0.1.0", optional = true } tokio-udp = { version = "0.1.0", optional = true } tokio-timer = { version = "0.2.8", optional = true } -tokio-trace-core = { version = "0.1", optional = true } +tokio-trace-core = { version = "0.2", optional = true } # Needed until `reactor` is removed from `tokio`. mio = { version = "0.6.14", optional = true } From 01052f930a56d7b7654c2dee630872a9d7ff8999 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Thu, 30 May 2019 14:39:30 -0700 Subject: [PATCH 2/5] Bump `tokio` version to v0.1.21. (#1113) --- tokio/CHANGELOG.md | 5 +++++ tokio/Cargo.toml | 4 ++-- tokio/README.md | 8 ++++---- tokio/src/lib.rs | 2 +- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/tokio/CHANGELOG.md b/tokio/CHANGELOG.md index afb0f934ad9..509d23eae77 100644 --- a/tokio/CHANGELOG.md +++ b/tokio/CHANGELOG.md @@ -1,6 +1,11 @@ This changelog only applies to the `tokio` crate proper. Each sub crate maintains its own changelog tracking changes made in each respective sub crate. +# 0.1.21 (May 30, 2019) + +### Changed +- Bump `tokio-trace-core` version to 0.2 (#1111). + # 0.1.20 (May 14, 2019) ### Added diff --git a/tokio/Cargo.toml b/tokio/Cargo.toml index 66f437e7a3c..83b5f6a0252 100644 --- a/tokio/Cargo.toml +++ b/tokio/Cargo.toml @@ -8,11 +8,11 @@ name = "tokio" # - README.md # - Update CHANGELOG.md. # - Create "v0.1.x" git tag. -version = "0.1.20" +version = "0.1.21" authors = ["Carl Lerche "] license = "MIT" readme = "README.md" -documentation = "https://docs.rs/tokio/0.1.20/tokio/" +documentation = "https://docs.rs/tokio/0.1.21/tokio/" repository = "https://github.com/tokio-rs/tokio" homepage = "https://tokio.rs" description = """ diff --git a/tokio/README.md b/tokio/README.md index 3d632f0e814..298780446c4 100644 --- a/tokio/README.md +++ b/tokio/README.md @@ -28,7 +28,7 @@ the Rust programming language. It is: [Website](https://tokio.rs) | [Guides](https://tokio.rs/docs/getting-started/hello-world/) | -[API Docs](https://docs.rs/tokio/0.1.19/tokio) | +[API Docs](https://docs.rs/tokio/0.1.21/tokio) | [Chat](https://gitter.im/tokio-rs/tokio) ## Overview @@ -45,9 +45,9 @@ level, it provides a few major components: These components provide the runtime components necessary for building an asynchronous application. -[net]: https://docs.rs/tokio/0.1.19/tokio/net/index.html -[reactor]: https://docs.rs/tokio/0.1.19/tokio/reactor/index.html -[scheduler]: https://docs.rs/tokio/0.1.19/tokio/runtime/index.html +[net]: https://docs.rs/tokio/0.1.21/tokio/net/index.html +[reactor]: https://docs.rs/tokio/0.1.21/tokio/reactor/index.html +[scheduler]: https://docs.rs/tokio/0.1.21/tokio/runtime/index.html ## Example diff --git a/tokio/src/lib.rs b/tokio/src/lib.rs index 9efe7429303..19766090ed3 100644 --- a/tokio/src/lib.rs +++ b/tokio/src/lib.rs @@ -1,4 +1,4 @@ -#![doc(html_root_url = "https://docs.rs/tokio/0.1.20")] +#![doc(html_root_url = "https://docs.rs/tokio/0.1.21")] #![deny(missing_docs, warnings, missing_debug_implementations)] //! A runtime for writing reliable, asynchronous, and slim applications. From 619efed28b64858016c9a3a5b0f425f3e32e076e Mon Sep 17 00:00:00 2001 From: Kevin Leimkuhler Date: Mon, 3 Jun 2019 11:12:28 -0700 Subject: [PATCH 3/5] sync: Add Sync impl for Lock (#1116) Signed-off-by: Kevin Leimkuhler --- tokio-sync/src/lock.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tokio-sync/src/lock.rs b/tokio-sync/src/lock.rs index 017af197cc6..3cfa1beb2f2 100644 --- a/tokio-sync/src/lock.rs +++ b/tokio-sync/src/lock.rs @@ -69,9 +69,11 @@ pub struct Lock { #[derive(Debug)] pub struct LockGuard(Lock); -// As long as T: Send, it's fine to send Lock to other threads. -// If T was not Send, sending a Lock would be bad, since you can access T through Lock. +// As long as T: Send, it's fine to send and share Lock between threads. +// If T was not Send, sending and sharing a Lock would be bad, since you can access T through +// Lock. unsafe impl Send for Lock where T: Send {} +unsafe impl Sync for Lock where T: Send {} unsafe impl Sync for LockGuard where T: Send + Sync {} #[derive(Debug)] From 970f75f830e4888f33bc65bad80f11457be5dd51 Mon Sep 17 00:00:00 2001 From: Kevin Leimkuhler Date: Tue, 4 Jun 2019 17:04:35 -0700 Subject: [PATCH 4/5] sync: Add Sync impl for Lock (#1117) --- tokio-sync/src/lock.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tokio-sync/src/lock.rs b/tokio-sync/src/lock.rs index b6153800fe6..2f8b32f88e1 100644 --- a/tokio-sync/src/lock.rs +++ b/tokio-sync/src/lock.rs @@ -72,9 +72,11 @@ pub struct Lock { #[derive(Debug)] pub struct LockGuard(Lock); -// As long as T: Send, it's fine to send Lock to other threads. -// If T was not Send, sending a Lock would be bad, since you can access T through Lock. +// As long as T: Send, it's fine to send and share Lock between threads. +// If T was not Send, sending and sharing a Lock would be bad, since you can access T through +// Lock. unsafe impl Send for Lock where T: Send {} +unsafe impl Sync for Lock where T: Send {} unsafe impl Sync for LockGuard where T: Send + Sync {} #[derive(Debug)] From 5dcb379f6da6e7bd97f5dde94706eecc1eed2de0 Mon Sep 17 00:00:00 2001 From: Kevin Leimkuhler Date: Wed, 5 Jun 2019 12:19:06 -0700 Subject: [PATCH 5/5] Bump `tokio-sync` to 0.1.6 (#1123) --- ci/azure-install-rust.yml | 12 +++++++++--- ci/azure-test-nightly.yml | 2 +- tokio-sync/CHANGELOG.md | 5 +++++ tokio-sync/Cargo.toml | 4 ++-- tokio-sync/README.md | 2 +- tokio-sync/src/lib.rs | 2 +- 6 files changed, 19 insertions(+), 8 deletions(-) diff --git a/ci/azure-install-rust.yml b/ci/azure-install-rust.yml index 654db47382b..136a9659987 100644 --- a/ci/azure-install-rust.yml +++ b/ci/azure-install-rust.yml @@ -2,7 +2,10 @@ steps: # Linux and macOS. - script: | set -e - curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN + curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none + export PATH=$PATH:$HOME/.cargo/bin + rustup toolchain install $RUSTUP_TOOLCHAIN + rustup default $RUSTUP_TOOLCHAIN echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin" env: RUSTUP_TOOLCHAIN: ${{parameters.rust_version}} @@ -11,13 +14,16 @@ steps: # Windows. - script: | + echo "windows" curl -sSf -o rustup-init.exe https://win.rustup.rs - rustup-init.exe -y --default-toolchain %RUSTUP_TOOLCHAIN% + rustup-init.exe -y --default-toolchain none set PATH=%PATH%;%USERPROFILE%\.cargo\bin + rustup toolchain install %RUSTUP_TOOLCHAIN% + rustup default %RUSTUP_TOOLCHAIN% echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin" env: RUSTUP_TOOLCHAIN: ${{parameters.rust_version}} - displayName: "Install rust (windows)" + displayName: Install rust (windows) condition: eq(variables['Agent.OS'], 'Windows_NT') # All platforms. diff --git a/ci/azure-test-nightly.yml b/ci/azure-test-nightly.yml index d739a1a9680..bbb44442619 100644 --- a/ci/azure-test-nightly.yml +++ b/ci/azure-test-nightly.yml @@ -12,7 +12,7 @@ jobs: - template: azure-patch-crates.yml - script: cargo check --all - displayName: cargo +nightly check --all + displayName: cargo check --all # Check benches - script: cargo check --benches --all diff --git a/tokio-sync/CHANGELOG.md b/tokio-sync/CHANGELOG.md index 0eaa7ed226f..60b500a24ba 100644 --- a/tokio-sync/CHANGELOG.md +++ b/tokio-sync/CHANGELOG.md @@ -1,3 +1,8 @@ +# 0.1.6 (June 4, 2019) + +### Added +- Add Sync impl for Lock (#1117). + # 0.1.5 (April 22, 2019) ### Added diff --git a/tokio-sync/Cargo.toml b/tokio-sync/Cargo.toml index 072694f29fc..bab2a1a00dd 100644 --- a/tokio-sync/Cargo.toml +++ b/tokio-sync/Cargo.toml @@ -8,12 +8,12 @@ name = "tokio-sync" # - README.md # - Update CHANGELOG.md. # - Create "v0.1.x" git tag. -version = "0.1.5" +version = "0.1.6" authors = ["Carl Lerche "] license = "MIT" repository = "https://github.com/tokio-rs/tokio" homepage = "https://tokio.rs" -documentation = "https://docs.rs/tokio-sync/0.1.5/tokio_sync" +documentation = "https://docs.rs/tokio-sync/0.1.6/tokio_sync" description = """ Synchronization utilities. """ diff --git a/tokio-sync/README.md b/tokio-sync/README.md index 74dfa4f5605..a35d5bc8e9d 100644 --- a/tokio-sync/README.md +++ b/tokio-sync/README.md @@ -2,7 +2,7 @@ Synchronization utilities -[Documentation](https://docs.rs/tokio-sync/0.1.5/tokio_sync/) +[Documentation](https://docs.rs/tokio-sync/0.1.6/tokio_sync/) ## Overview diff --git a/tokio-sync/src/lib.rs b/tokio-sync/src/lib.rs index 6439acdd243..cd7914625cd 100644 --- a/tokio-sync/src/lib.rs +++ b/tokio-sync/src/lib.rs @@ -1,4 +1,4 @@ -#![doc(html_root_url = "https://docs.rs/tokio-sync/0.1.5")] +#![doc(html_root_url = "https://docs.rs/tokio-sync/0.1.6")] #![deny(missing_debug_implementations, missing_docs, unreachable_pub)] #![cfg_attr(test, deny(warnings))]