BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet software
Classes | Public Member Functions | Friends | List of all members
fc::serial_valve Class Reference

#include <parallel.hpp>

Public Member Functions

 serial_valve ()
 
 ~serial_valve ()
 
template<typename Functor1 , typename Functor2 >
auto do_serial (const Functor1 &f1, const Functor2 &f2) -> decltype(f2())
 

Friends

class ticket_guard
 

Detailed Description

Definition at line 50 of file parallel.hpp.

Constructor & Destructor Documentation

◆ serial_valve()

fc::serial_valve::serial_valve ( )

Definition at line 191 of file parallel.cpp.

◆ ~serial_valve()

fc::serial_valve::~serial_valve ( )

Definition at line 196 of file parallel.cpp.

Member Function Documentation

◆ do_serial()

template<typename Functor1 , typename Functor2 >
auto fc::serial_valve::do_serial ( const Functor1 &  f1,
const Functor2 &  f2 
) -> decltype(f2())
inline

Executes f1() then f2(). For any two calls do_serial(f1,f2) and do_serial(f1',f2') where do_serial(f1,f2) is invoked before do_serial(f1',f2'), it is guaranteed that f2' will be executed after f2 has completed. Failure of either function counts as completion of both. If f1 throws then f2 will not be invoked.

Parameters
f1a functor to invoke
f2a functor to invoke
Returns
the return value of f2()

Definition at line 81 of file parallel.hpp.

Friends And Related Function Documentation

◆ ticket_guard

friend class ticket_guard
friend

Definition at line 62 of file parallel.hpp.


The documentation for this class was generated from the following files: