1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-06-27 06:09:02 +02:00

remove RUNNING Q PENDING thread locals from actix-rt (#207)

This commit is contained in:
fakeshadow
2020-12-27 07:26:02 +08:00
committed by GitHub
parent 43ce25cda1
commit 518bf3f6a6
10 changed files with 273 additions and 274 deletions

View File

@ -4,6 +4,8 @@
#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]
use std::future::Future;
#[cfg(not(test))] // Work around for rust-lang/rust#62127
pub use actix_macros::{main, test};
@ -22,15 +24,12 @@ pub use self::system::System;
/// # Panics
///
/// This function panics if actix system is not running.
#[inline]
pub fn spawn<F>(f: F)
where
F: futures_util::future::Future<Output = ()> + 'static,
F: Future<Output = ()> + 'static,
{
if !System::is_set() {
panic!("System is not running");
}
Arbiter::spawn(f);
Arbiter::spawn(f)
}
/// Asynchronous signal handling