⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 scope_guard.hpp

📁 linux 环境下比较好的一个线程池实现源代码
💻 HPP
字号:
/*! \file* \brief TODO.** TODO. ** Copyright (c) 2005-2007 Philipp Henkel** Use, modification, and distribution are  subject to the* Boost Software License, Version 1.0. (See accompanying  file* LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)** http://threadpool.sourceforge.net**/#ifndef THREADPOOL_DETAIL_SCOPE_GUARD_HPP_INCLUDED#define THREADPOOL_DETAIL_SCOPE_GUARD_HPP_INCLUDED#include <boost/function.hpp>namespace boost { namespace threadpool { namespace detail {// TODO documentationclass scope_guard: private boost::noncopyable{	function0<void> const m_function;	bool                  m_is_active;public:	scope_guard(function0<void> const & call_on_exit)	: m_function(call_on_exit)	, m_is_active(true)	{	}	~scope_guard()	{		if(m_is_active && m_function)		{			m_function();		}	}	void disable()	{		m_is_active = false;	}};} } } // namespace boost::threadpool::detail#endif // THREADPOOL_DETAIL_SCOPE_GUARD_HPP_INCLUDED

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -