# stop

Request task cancellation

Last updated: 2026-09-09

Package: language | Status: experimental

Tags: concurrency, cpu, keyword, language, yeho

Use the narrowest wait that explains progress. Treat stop as a lifecycle request, not proof that cleanup already finished.

```yh
stop
```


## Complete program

Coordinate CPU tasks explicitly. Cancellation is a request; a short task may finish first.

Verification: type checked

```yh
// task is the supported CPU concurrency unit; thread syntax is unavailable.
Count() -> int { return 42 }
task of int worker = task Count()
stop worker
wait until worker.finished
Console.Log(Text.From(worker.cancelled))
parallel
{
    Console.Log("Preparing textures")
    Console.Log("Preparing audio")
}

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.word__stop"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/word--stop/complete --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


Supported duration units are target-validated.

parallel failure and cleanup semantics are covered by dedicated fixtures, but the feature is experimental.

Source: yeho/parser_statements.cpp parseWaitStatement; errors-tasks-effects fixtures

AI training permission: https://demonhunterlabs.com/ai-use
