-
Notifications
You must be signed in to change notification settings - Fork 72
Implemented recursive lock using pthread mutex #42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Love the idea 👍 |
80f8637
to
f65949b
Compare
Managed to implement thread safety tests for Linux 😫 I think it will be not very hard to port all other tests. Will do that later in a separate PR.
|
} | ||
} | ||
|
||
sleep(2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to let al the threads finish. Of course joining each thread would be better (then dispatch_xxx should return thread's pid). Again it's only because of limitations of swift-core libs, in this case xctest does not provide async utils yet.
I'll trust you on this one and let you merge this when you're ready, because I won't have time to install a Linux VM on my Mac to test the code in there 😉 |
Ok =) I really hope it will work. At least with tests I was able to fix the issue with I'm still struggling to understand how to organize Linux tests better, for instance how to avoid putting all of them in one file, but I will address that in a separate PR. |
Implemented recursive lock using pthread mutex
Would be cool if Dip will not depend on Foundation. The only dependency now is NSRecursiveLock. So I grabbed implementation from here
Still needs to be tested. Will try it later on virtual machine, but need to set it up first.