fn check
Inside atomic { }: when cond is false the transaction is abandoned, the task waits (without holding a thread, and it can be
cancelled) until a TVar the transaction has read changes, and the block runs again.
Example:
use std.stm { TVar, check }
fn main() io {
let ready = TVar(true)
atomic {
check(ready.get())
}
print("passed")
}Вывод
passed
pub(api) fn check(cond: bool)С версии. 1.0.0-beta
Параметры
| Имя | Тип |
|---|---|
cond | bool |
Эффекты
не объявлены (чистая, пока тело не говорит иное)
Определено в: std/stm/stm.oxl:185