mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
vlib/context: add onecontext as submodule (#12549)
This commit is contained in:
committed by
GitHub
parent
2144471ce1
commit
f7926ec9a4
@@ -51,9 +51,10 @@ mut:
|
||||
pub fn with_cancel(mut parent Context) (Context, CancelFn) {
|
||||
mut c := new_cancel_context(parent)
|
||||
propagate_cancel(mut parent, mut c)
|
||||
return Context(c), fn [mut c] () {
|
||||
cancel_fn := fn [mut c] () {
|
||||
c.cancel(true, canceled)
|
||||
}
|
||||
return Context(c), CancelFn(cancel_fn)
|
||||
}
|
||||
|
||||
// new_cancel_context returns an initialized CancelContext.
|
||||
|
||||
Reference in New Issue
Block a user