mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-07 00:00:08 +02:00
@@ -331,7 +331,7 @@ fn coop_and_block_in_place() {
|
||||
// runtime worker yielded as part of `block_in_place` and guarantees the
|
||||
// same thread will reclaim the worker at the end of the
|
||||
// `block_in_place` call.
|
||||
.max_threads(1)
|
||||
.max_blocking_threads(1)
|
||||
.build()
|
||||
.unwrap();
|
||||
|
||||
@@ -375,9 +375,18 @@ fn coop_and_block_in_place() {
|
||||
|
||||
// Testing this does not panic
|
||||
#[test]
|
||||
fn max_threads() {
|
||||
fn max_blocking_threads() {
|
||||
let _rt = tokio::runtime::Builder::new_multi_thread()
|
||||
.max_threads(1)
|
||||
.max_blocking_threads(1)
|
||||
.build()
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[should_panic]
|
||||
fn max_blocking_threads_set_to_zero() {
|
||||
let _rt = tokio::runtime::Builder::new_multi_thread()
|
||||
.max_blocking_threads(0)
|
||||
.build()
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user