-
Notifications
You must be signed in to change notification settings - Fork 209
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
[windows] Implement pthread_mutex for Windows #257
Conversation
eea1348
to
93143eb
Compare
Can you give some background on what versions or variations of Windows does not have pthread? There are tests run on AppVeyor, so at least some version of Windows has it. Though, I'm not familiar with what version of Windows is actually used there. At least the compiler versions we test against expose pthreads. If Check were to support Windows not having pthread we would need a way to test it. That is, some confidence the lack of pthread can be properly detected and when build to use critical sections the result works correctly. |
afaict, Windows doesn't natively support |
Thanks for that explanation. It did not occur to me that Windows would not have pthreads natively, though that does make sense. So all this time the protections have been no-ops.... A bit of a miss -- thanks for pointing it out and volunteering to fix it! If that is the case, Check's existing automated tests on AppVeyor should provide coverage. Disregard that part of my earlier comments. Given that not having either pthreads caused an issue that Check was unable to detect in its unit tests, maybe it should be a configure-time failure if pthreads (and now critical sections) is unavailable. Or, maybe at least a warning of some sort. I see that I did not finish the migration from Travis-CI to Github Actions, so the Linux and OSX automated tests did not run for your PR. I'll finish that up now. In a bit I'll let you know, so you can update your branch to pickup testing for Linux and OSX. |
I've enabled the Linux and OSX tests now on Github. Update your branch to pick them up. |
93143eb
to
34d1196
Compare
6fdab75
to
b74c43e
Compare
@brarcher Sorry for the delay, I updated the patch according to our previous discussion. |
587d3e6
to
1115e47
Compare
@@ -112,7 +114,7 @@ if(WIN32) | |||
if(MSVC60) | |||
set(WINVER 0x0400) | |||
else() | |||
set(WINVER 0x0500) | |||
set(WINVER 0x0600) |
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.
I'm not familiar with Windows' versioning. Can you explain this change?
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.
The One-Time Initialization functions were introduced in Windows Vista. The WINVER
value for Windows Vista is 0x0600.
I appreciate your adding support for both Autotools and CMake. (: |
When compiling for Windows, pthread libraries may not be available. For Win32 applications in which an external implementation of pthread is not available, we build libcompat with the pthread_mutex.c module, which provides a simple implementation of pthread_mutex for the Win32 API.
1115e47
to
9bcf6e8
Compare
Thanks for implementing this! |
@brarcher Is it possible we get a new release of the library? I would like to update the meson wrapdb. |
Sure. I'll create a release today. |
Check 0.15.0 has been released. |
Thanks a lot \o/ |
When compiling for Windows, pthread libraries may not be available. For
Win32 applications in which an external implementation of pthread is not available, we build libcompat with the pthread_mutex.c module, which provides a simple implementation of pthread_mutex for the Win32 API.