Skip to content
Unverified Commit bf1f2ab6 authored by Ilya Isaev's avatar Ilya Isaev Committed by GitHub
Browse files

Add collaborative_call_once algorithm (#397)



collaborative_call_once is a function similar to std::call_once but allows waiting threads to join oneTBB parallel construction called inside the initializing functor. The semantics of exceptions is also similar to std::call_once: whenever the exception is thrown, it is rethrown on the initializing thread and this or other thread can try to call initializing functor again until it is completed without an exception.

This pull request integrates #357. It is reworked to avoid dynamic memory allocation and fit the state into one word (see state machine in #267).  In cooperation with @BenFrantzDale @HenryHeffanFormlabs

Signed-off-by: default avatarIlya Isaev <ilya.isaev@intel.com>

Co-authored-by: default avatarAlex <alexei.katranov@intel.com>
parent fde18567
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment