在MAC死锁上是Pthread RWLock,但在Linux上不是? [英] Pthread RWLock on MAC Deadlocking but not on Linux?

查看:86
本文介绍了在MAC死锁上是Pthread RWLock,但在Linux上不是?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在Mac上尝试使用rwlock,并且正在经历某种我认为不应该发生的事情.使用读/写锁和递归读锁有一些怪异的组合,但这种组合是死锁的,但不应该这样.

I've been experimenting with rwlock's on Mac and am experiencing something that seems to me shouldn't be happening. There's some weird combination of using read/write locks with recursive read locks that is deadlocking, but shouldn't be.

我将代码发布到pastebin上,因为它不仅仅是一个片段.编写此代码的方式不会死锁,并且在Linux上运行时也不会死锁.为什么在Mac上会出现这种死锁?

I posted the code on pastebin because it's more than just a snippet. The way this code is written shouldn't deadlock, and indeed doesn't when running on linux. Why does this deadlock on a mac?

http://pastebin.com/Ui9iS1ke

有什么想法吗?

推荐答案

这是打开的雷达错误.

http://openradar.appspot.com/8588290

这篇关于在MAC死锁上是Pthread RWLock,但在Linux上不是?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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