说明说得很明白,就是等侍num_closures 为零的时候回调done_closure,代码也很简单,不加详述
#ifndef BASE_BARRIER_CLOSURE_H_
#define BASE_BARRIER_CLOSURE_H_
 
#include "base/base_export.h"
#include "base/callback_forward.h"
 
namespace base {
 
// BarrierClosure executes |done_closure| after it has been invoked
// |num_closures| times.
//
// If |num_closures| is 0, |done_closure| is executed immediately.
//
// BarrierClosure is thread-safe - the count of remaining closures is
// maintained as a base::AtomicRefCount. |done_closure| will be run on
// the thread that calls the final Run() on the returned closures.
//
// |done_closure| is also Reset() on the final calling thread but due to the
// refcounted nature of callbacks, it is hard to know what thread resources
// will be released on.
BASE_EXPORT base::Closure BarrierClosure(int num_closures,
const base::Closure& done_closure);
 
} // namespace base
 
#endif // BASE_BARRIER_CLOSURE_H_

 

base库中的BarrierClosure的更多相关文章

  1. google base库中的WaitableEvent

    这个类说白了就是对windows event的封装,没有什么特别的,常规做法,等侍另一线程无非就是等侍事件置信waitsingleobject,通知事件无非就是setevent,一看就明白,不就详解, ...

  2. python学习笔记——urllib库中的parse

    1 urllib.parse urllib 库中包含有如下内容 Package contents error parse request response robotparser 其中urllib.p ...

  3. Chromium base库分割字符串SplitString

    前一段时间在工作过程中遇到一个场景需要将http response中的request header中的cookie字段取出并进行解析,但是手头没有解析cookie的工具类,同时cookie的表现就是个 ...

  4. MySql 查询数据库中所有表名以及对比分布式库中字段和表的不同

    查询数据库中所有表名select table_name from information_schema.tables where table_schema='数据库名' and table_type= ...

  5. stm32存储器映像和标准库中定义外设地址的方法

    结合存储器映像理解stm32标准库中定义外设地址的方法. stm32f103zet6是32位的.它所能访问的地址空间范围为2^32=4GB,把4GB分为8个block,分别为block0-block- ...

  6. 在Azure上的VM镜像库中找到想要的镜像

    Azure上的虚机镜像库中, 有很多的镜像,其中当然也包括了用户自定义上传的镜像. 在Powershell中如果想使用这些镜像的话, 则需要知道其名称 下面这条命令,可以获得所有的镜像信息 $imag ...

  7. Arduino下LCD1602综合探究(下)——如何减少1602的连线,LiquidCrystal库,LiquidCrystal库中bug的解决方法

    一.前言: 上文中,笔者系统的阐述了1602的两种驱动方式,并简单的提到了Arduino的LiquidCrystal库.本文紧接上文,对以下两个问题进行更加深入的探讨:如何能够使1602对Arduin ...

  8. SharePoint 2013 文档库中PPT转换PDF

    通过使用 PowerPoint Automation Services,可以从 PowerPoint 二进制文件格式 (.ppt) 和 PowerPoint Open XML 文件格式 (.pptx) ...

  9. sql 从一个库中取某个表的数据导入到另一个库中相同结构的表中

    sql 2008 从一个库中把 某个表中的数据导入到另一个库中的具有相同结构的表中 use 库1 go insert into  库1.dbo.表1  select * from  库2.dbo.表1 ...

随机推荐

  1. OSError: [Errno 13] Permission denied: '/etc/cron.d/1sandbox_registration'

    使用Hortonworks 的twitter tutorial: http://hortonworks.com/hadoop-tutorial/how-to-refine-and-visualize- ...

  2. 解决升级Xcode后插件不能使用的问题

    从Xcode 5开始,苹果要求加入UUID证书从而保证插件的稳定性.因此Xcode版本更新之后需要在插件的Info.plist文件中添加当前Xcode的UUID. 具体步骤如下: 1.获取Xcode的 ...

  3. C语言中宏定义(#define)时do{}while(0)的价值(转)

    C语言中宏定义(#define)时do{}while(0)的价值 最近在新公司的代码中发现到处用到do{...}while(0),google了一下,发现Stack Overflow上早有很多讨论,总 ...

  4. hdu2309ICPC Score Totalizer Software

    Problem Description The International Clown and Pierrot Competition (ICPC), is one of the most disti ...

  5. linux学习笔记之零散笔记。

    部分知识,不足以成为完整博文.但又不能随意抛弃. 1,文件名建议字符集:字母+数字+ ./-/_   尽量不要使用其他符号.因为特殊符号在很多功能中已经被占用. 2,系统调用通常提供最小接口(最简易) ...

  6. C# 添加服务引用。

    1,服务引用给的实例(需要一个网址连接) http://192.168.17.131:12170/amtiot.gis.WCF/SpatialAnalysis.svc  (类似于这样的一个网址) 在网 ...

  7. 开源轻量级移动端友好的JS地图库——leaflet学习教程

    Leaflet 是一个为建设交互性好适用于移动设备地图,而开发的现代的.开源的 JavaScript 库.代码仅有 33 KB,但它具有开发在线地图的大部分功能.Leaflet设计坚持简便.高性能和可 ...

  8. 通过Wmi实现Hyper-V远程管理(一)

    最近公司需要做Hyper-V的远程管理,在现有产品基础上扩展对Hyper V的管理,实现远程开关机.远程开启虚拟机会话,其他内容可查看MSDN中有对Hyper-V的描述和相关实例代码. Wmi操作hy ...

  9. ASCII码排序,hdu-2000

    Problem Description 输入三个字符后,按各字符的ASCII码从小到大的顺序输出这三个字符.   Input 输入数据有多组,每组占一行,有三个字符组成,之间无空格.   Output ...

  10. MFC 遍历FTP服务器目录中文乱码问题

    在编写FTP客户端的时候我用的是server u来做我的测试服务器,而server u 默认使用utf-8作为默认字符集,vs则使用unicode作为默认字符集,所以会产生乱码,将server u的默 ...