如何等待线程直到它开始运行
How to wait for a thread till it has started running
我目前有这样的东西
这是我班级的成员
boost::shared_ptr<boost::thread_group> my_group;
在我的代码中的其他地方,我这样做
my_group->create_thread( boost::bind( &Myclass::method, this ) );
现在在上面的声明中,我有没有办法阻止/等待这个线程启动?如
wait for above thread to lauch and start
Do next stuff after that.
因此,正如文档所说:
后置条件:this->size() 增加 1,新线程为 运行。
调用此成员函数后,线程已在运行。在那之后,你可以立即做你的下一件事。
相关文章:
- 当回溯以零开始时,如何调试崩溃
- 运行同一解决方案的另一个项目的项目
- CMake-按正确顺序将项目与C运行时对象文件链接
- 如何运行位于boost/libs/python/example/tutorial目录中的hello.cpp和Jamfil
- 代码在main()中运行,但在函数中出现错误
- 如何将参数传递给已经开始运行的线程
- 正在尝试循环回到开始以再次运行我的程序
- 在运行时开始时填充两个大向量
- 配方在第一个目标之前开始.停.运行生成文件时
- 简单的cin cout代码由"build and run"运行,但从bin/debug/x开始工作.exe
- 多线程 - DO线程同时开始运行
- 如何等待线程直到它开始运行
- 获取应用开始运行的目录(C++ 代码)
- "开始"不调用运行
- dev 我刚刚开始使用 DEV C++编译器。一些在涡轮编译器中运行良好的程序在开发编译器中没有运行。怎么办?
- 任务调度程序:从当前时刻开始,每小时运行一次任务
- 如何访问尚未开始运行的挂起线程的堆栈?
- 当我的 Boost::asio tcp 服务器刚刚开始运行时,如何启动"event"(又名 io_service.run() )?
- 如何在VS2015中开始调试之前运行一个脚本可执行文件
- 在每分钟开始时运行一个函数