From ebb5ba787a3341ffd376c72904ebce273aeacf04 Mon Sep 17 00:00:00 2001 From: cxl Date: Sat, 9 Jan 2016 19:19:45 +0000 Subject: [PATCH] .docs git-svn-id: svn://ultimatepp.org/upp/trunk@9387 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/Core/src.tpp/CoWork$en-us.tpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/uppsrc/Core/src.tpp/CoWork$en-us.tpp b/uppsrc/Core/src.tpp/CoWork$en-us.tpp index bcce55d71..64bc8fb06 100644 --- a/uppsrc/Core/src.tpp/CoWork$en-us.tpp +++ b/uppsrc/Core/src.tpp/CoWork$en-us.tpp @@ -41,7 +41,7 @@ onst]_[_^Upp`:`:Callback^ Callback][@(0.0.255) `&]_[*@3 cb])&] to data done before Do are visible in the scheduled code. The order of execution or whether the code is execute in another or calling thread is not specified.&] -[s3;%% &] +[s3; &] [s4; &] [s5;:Upp`:`:CoWork`:`:operator`&`(const Upp`:`:Callback`&`): [_^Upp`:`:CoWork^ CoWork][@(0.0.255) `& ]_[* operator`&]([@(0.0.255) const]_[_^Upp`:`:Callback^ Callback][@(0.0.255) `&]_[*@3 cb])&] @@ -51,6 +51,15 @@ oWork][@(0.0.255) `&]_[* operator`&]([@(0.0.255) const]_[_^std`:`:function^ std` [s2;%% Same as Do([%-*@3 cb ][/ or] [%-*@3 lambda]); returns `*this;&] [s3;%% &] [s4; &] +[s5;:Upp`:`:CoWork`:`:FinLock`(`): [@(0.0.255) static] [@(0.0.255) void]_[* FinLock]()&] +[s2;%% This functions is to be called in scheduled routine. Its purpose +is to serialize access to shared data at the end of the routine. +The rationale is that CoWork has to lock some mutex anyway after +scheduled code finishes, so FinLock can lock this mutex a bit +earlier, joining two mutex locks into single one. Of course, +as with all locks, execution of locked code should be short.&] +[s3;%% &] +[s4; &] [s5;:CoWork`:`:Finish`(`): [@(0.0.255) void]_[* Finish]()&] [s2;%% Waits until all jobs scheduled using Do (or operator`&) are finished. All changes to data performed by scheduled threads