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.
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?
Any ideas?