x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
thread_data.hpp - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\thread\pthread\thread_data.hpp
旋转
特效
属性
历史版本
#ifndef BOOST_THREAD_PTHREAD_THREAD_DATA_HPP #define BOOST_THREAD_PTHREAD_THREAD_DATA_HPP // Distributed under 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) // (C) Copyright 2007 Anthony Williams #include
#include
#include
#include
#include
#include
#include "condition_variable_fwd.hpp" namespace boost { class thread_interrupted {}; namespace detail { struct thread_exit_callback_node; struct tss_data_node; struct thread_data_base; typedef boost::shared_ptr
thread_data_ptr; struct thread_data_base: enable_shared_from_this
{ thread_data_ptr self; pthread_t thread_handle; boost::mutex data_mutex; boost::condition_variable done_condition; boost::mutex sleep_mutex; boost::condition_variable sleep_condition; bool done; bool join_started; bool joined; boost::detail::thread_exit_callback_node* thread_exit_callbacks; boost::detail::tss_data_node* tss_data; bool interrupt_enabled; bool interrupt_requested; pthread_cond_t* current_cond; thread_data_base(): done(false),join_started(false),joined(false), thread_exit_callbacks(0),tss_data(0), interrupt_enabled(true), interrupt_requested(false), current_cond(0) {} virtual ~thread_data_base() {} virtual void run()=0; }; BOOST_THREAD_DECL thread_data_base* get_current_thread_data(); class interruption_checker { thread_data_base* const thread_info; void check_for_interruption() { if(thread_info->interrupt_requested) { thread_info->interrupt_requested=false; throw thread_interrupted(); } } void operator=(interruption_checker&); public: explicit interruption_checker(pthread_cond_t* cond): thread_info(detail::get_current_thread_data()) { if(thread_info && thread_info->interrupt_enabled) { lock_guard
guard(thread_info->data_mutex); check_for_interruption(); thread_info->current_cond=cond; } } ~interruption_checker() { if(thread_info && thread_info->interrupt_enabled) { lock_guard
guard(thread_info->data_mutex); thread_info->current_cond=NULL; check_for_interruption(); } } }; } } #endif
thread_data.hpp
网页地址
文件地址
上一页
9/11
下一页
下载
( 3 KB )
Comments
Total ratings:
0
Average rating:
无评论
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.