Sign in
rust
/
rust-by-example
/
refs/heads/macros
/
.
/
examples
/
tasks
/
tasks.rs
blob: d1cafaaf630477c4511fc65db5935860fc37a775 [
file
] [
log
] [
blame
]
static
NTASKS
:
int
=
10
;
// This is the `main` task
fn
main
()
{
for
i in range
(
0
,
NTASKS
)
{
// Spin up another task
spawn
(
proc
()
{
println
!(
"this is task number {}"
,
i
)
});
}
}