在Windows版本使用pthreads.h中 [英] Using pthread.h on a windows build

查看:595
本文介绍了在Windows版本使用pthreads.h中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个codeBase的是广泛使用的pthreads.h中。在Windows Visual Studio项目,这显然不能因为工作pthreads的是UNIX工具。

I have a codebase that makes extensive use of pthread.h. On a windows visual studio project, this obviously doesn't work since pthreads is a unix utility.

我知道存在的pthread-win32的或诸如此类的东西,但有没有办法有一个codeBase的使用,无需更换全部的pthread code的?

I know there exists pthread-win32 or something of the sort, but is there a way to have a codebase use this, without replacing all of the pthread code?

编辑:我想preFER不要经过并更换所有pthread调用。这是我的问题。

edit: I'd prefer to not have to go through and replace all the pthread calls. This is my question

推荐答案

尝试 http://sourceware.org/ pthreads的-的Win32 / 。虽然我从来没有使用过该库中,我已经使用POSIX API的一些窗户端口/抽象层有好运。

Try http://sourceware.org/pthreads-win32/. While I've never used that particular library, I've had luck using some windows ports/abstraction layers of POSIX APIs.

这篇关于在Windows版本使用pthreads.h中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆