Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/third_party/rust/tokio/tests/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 818 B image not shown  

Quelle  process_issue_7144.rs

  Sprache: Rust
 

#![cfg(feature = "process")]
#![warn(rust_2018_idioms)]
#![cfg(target_os = "linux")]
#![cfg(not(miri))]

use tokio::process::Command;
use tokio::time::{sleep, Duration};

#[tokio::test]
async fn issue_7144() {
    let mut threads = vec![];
    for _ in 0..20 {
        threads.push(tokio::spawn(test_one()));
    }
    for thread in threads {
        thread.await.unwrap();
    }
}

async fn has_strace() -> bool {
    Command::new("strace").arg("-V").output().await.is_ok()
}

async fn test_one() {
    if !has_strace().await {
        return;
    }

    let mut t = Command::new("strace")
        .args("-o /dev/null -D sleep 5".split(' '))
        .spawn()
        .unwrap();
    sleep(Duration::from_millis(100)).await;
    unsafe { libc::kill(t.id().unwrap() as _, libc::SIGINT) };
    t.wait().await.unwrap();
}

Messung V0.5 in Prozent
C=92 H=91 G=91

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.