原文地址:http://www.cplusplus.com/reference/thread/thread/native_handle/
public member function
<thread>
std::thread::native_handle
native_handle_type native_handle();
Get native handle
This member function is only present in classthreadif the library implementation supports it.
只有库函数支持该函数时该方法才会有效。
If present, it returns a value used to accessimplementation-specificinformation associated to the thread.
如果有效,用于获得与操作系统相关的原生线程句柄
例子:
#include <iostream>
#include <thread>
#include <ctime>
using namespace std;
void show(int n){
cout<<"n="<<n<<endl;
}
int main()
{
thread t(show,18);
cout<<"t.get_id="<<t.get_id()<<endl;
auto tn=t.native_handle();
t.join();
cout<<"tn="<<tn<<endl;
}
运行截图:
Parameters
none
Return value
A value of member typethread::native_handle_type.
Data races
Unspecified.
Exception safety
Unspecified.
—————————————————————————————————————————————————————————————————
//写的错误或者不好的地方请多多指导,可以在下面留言或者点击左上方邮件地址给我发邮件,指出我的错误以及不足,以便我修改,更好的分享给大家,谢谢。
转载请注明出处:http://blog.csdn.net/qq844352155
author:天下无双
Email:coderguang@gmail.com
2014-9-4
于GDUT
——————————————————————————————————————————————————————————————————
分享到:
相关推荐
C++程序设计:第7章_数组2.ppt
Beyond_the_C++_Standard_Library:An_Introduction_to_Boost
ARMA时间序列分析的C++程序,可以直接使用,对于学习时间序列分析的有帮助
基于acl库封装的redis client vs2010工程; 运行时解压到: redis-acl\lib_acl_cpp\samples\redis路径下,把lib_acl_vc2010d.lib、lib_acl_cpp_vc2010d.lib放到 \redis-acl\lib_acl_cpp\samples\redis\redisclient...
主要介绍了C++11 std::shared_ptr总结与使用,本文通过示例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下
ndk-Android C++高级编程:使用NDK_Onur Cinar,于红.zipndk-Android C++高级编程:使用NDK_Onur Cinar,于红.zipndk-Android C++高级编程:使用NDK_Onur Cinar,于红.zipndk-Android C++高级编程:使用NDK_Onur Cinar,...
C++11中的std::packaged_task是个模板类。std::packaged_task包装任何可调用目标(函数、lambda表达式、bind表达式、函数对象)以便它可以被异步调用。它的返回值或抛出的异常被存储于能通过std::future对象访问的共享...
本书号称『高速上手』,从内容上对二十一世纪二十年代之前产生C++的相关特性做了非常相对全面的介绍,读者可以自行根据下面的目录选取感兴趣的内容进行学习,快速熟悉需要了解的内容。这些特性并不需要全部掌握,只...
_01:C++历史演进 _02:C++基础语法 _03:运算符与表达式 _04:C++容器 _05:指针与引用 _06:基础句法 _07:高级语法 _08:编程思想 _09:进阶编程 _10:桌面项目的设计与架构 _11:桌面播放器通用模块开发 _12:编写UI界面 _13...
Android C++高级编程:使用NDK_中文,高清带目录,高级进阶必备书籍
《C++程序设计原理与实践》里作者整合过的头文件:std_lib_facilities.h
代码重点是hash_table,附加std::map与其做对比,实现的是一条sql语句:select c_nationkey, c_mktsegment, count(*), max(c_acctbal) from aaa_customer_1g group by c_nationkey, c_mktsegment order by c_...
PCAtools:一切主成分分析_R_C++_下载
使用纯C++编写的json解析文件,此文件解析速度快
非常好用的C++注册表操作类,看示例 // 使用示例: // RegistryKey hklm = Registry.LocalMachine; // RegistryKey aa = hklm.OpenSubKey("System\\CurrentControlSet\\Services\\Lanmanserver\\parameters", TRUE); /...
native Regex: Regex_New ( const pattern[], E_REGEX_FLAG: flags = REGEX_DEFAULT, E_REGEX_GRAMMAR: grammar = REGEX_ECMASCRIPT); native Regex_Delete ( & Regex: r); native Regex_Check ( const str[], Regex...
C++11 并发指南五(stdcondition_variable 详解).docx
C++Builder函数库, Date 返回TDateTime对象,包含当前的年月日信息,函数原型如下: System::TDateTime __fastcall Date(void); 2. Time 返回TDateTime对象,包含当前的时间信息,函数原型如下: System:...
前面两讲《C++11 并发指南二(std::thread 详解) 》,《C++11 并发指南三(std::mutex 详解) 》分别介绍了 std::thread 和 std::mutex,相信读者对 C++11 中的多线程编程有了一个最基本的认识,本文将介绍 C++11 标准...