#pragma once #include "rw_spin_lock.h" #include namespace NYT::NThreading { //////////////////////////////////////////////////////////////////////////////// using TAtForkHandler = std::function; //! Registers handlers to be invoked at fork time. //! See |pthread_atfork| for more details. /*! * Once all prepare handlers are invoked, fork lock is acquired * in writer mode. This lock is subsequently released in both child * and parent processes once fork is complete. */ void RegisterAtForkHandlers( TAtForkHandler prepare, TAtForkHandler parent, TAtForkHandler child); //! Returns the fork lock. TReaderWriterSpinLock* GetForkLock(); //////////////////////////////////////////////////////////////////////////////// } // namespace NYT::NThreading