File: thread.rs

package info (click to toggle)
rustc 1.85.0%2Bdfsg2-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 893,176 kB
  • sloc: xml: 158,127; python: 35,830; javascript: 19,497; cpp: 19,002; sh: 17,245; ansic: 13,127; asm: 4,376; makefile: 1,051; lisp: 29; perl: 29; ruby: 19; sql: 11
file content (31 lines) | stat: -rw-r--r-- 954 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Testing the display of JoinHandle and Thread in cdb.

// cdb-only
//@ min-cdb-version: 10.0.18317.1001
//@ compile-flags:-g

// === CDB TESTS ==================================================================================
//
// cdb-command:g
//
// cdb-command:dx join_handle,d
// cdb-check:join_handle,d    [Type: std::thread::JoinHandle<tuple$<> >]
// cdb-check:    [...] __0              [Type: std::thread::JoinInner<tuple$<> >]
//
// cdb-command:dx -r3 t,d
// cdb-check:t,d              : [...] [Type: std::thread::Thread *]
// cdb-check:    [...] __0              : Other [Type: enum2$<std::thread::Inner>]
// cdb-check:         [...] __0              [Type: core::pin::Pin<alloc::sync::Arc<std::thread::OtherInner,[...]> >]

use std::thread;

#[allow(unused_variables)]
fn main() {
    let join_handle = thread::spawn(|| {
        println!("Initialize a thread");
    });
    let t = join_handle.thread();
    zzz(); // #break
}

fn zzz() {}