如何在Linux上检查pthread的线程活动性? [英] How to check thread's aliveness on linux for pthread?
本文介绍了如何在Linux上检查pthread的线程活动性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试将C ++项目迁移到Linux平台.我在Linux上使用GCC编译器.在Windows上,我们使用CreateThread创建线程.
在Linux上,我正在使用pthread.
我想检查线程是否存在.在Windows上,我为此使用WaitForSingleObject.
我可以在linux上实现的方式是什么?
Hi,
I am trying to migrate a C++ project to linux platform. I am using GCC compiler on Linux. On windows we were using CreateThread to create threads.
Here on Linux i am using pthread.
I want to check whether thread is alive or dead. On windows i use WaitForSingleObject for the this.
What is the way by which i can achieve this on linux ?
推荐答案
这应该有所帮助:
http://stackoverflow.com/questions/2719580/waitforsingleobject-and-waitformultipleobjects-equivalent-在Linux中 [ ^ ]
This should help:
http://stackoverflow.com/questions/2719580/waitforsingleobject-and-waitformultipleobjects-equivalent-in-linux[^]
这篇关于如何在Linux上检查pthread的线程活动性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文