| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| } native; | ||
| } git_rwlock; | ||
|
|
||
| #define PTHREAD_MUTEX_INITIALIZER {(void*)-1} |
There was a problem hiding this comment.
I was going to suggest we rename this, but I think it's wholly unused so perhaps we should just remove it.
Sorry, something went wrong.
There was a problem hiding this comment.
Agreed, will remove.
Sorry, something went wrong.
|
Thanks for taking care of this. I made a couple of quite trivial comments, but this is great. 😀 |
Sorry, something went wrong.
The function pthread_num_processors_np is currently unused and superseded by the function `git_online_cpus`. Remove the function.
The old pthread-file did re-implement the pthreads API with exact symbol matching. As the thread-abstraction has now been split up between Unix- and Windows-specific files within the `git_` namespace to avoid symbol-clashes between libgit2 and pthreads, the rewritten wrappers have nothing to do with pthreads anymore. Rename the Windows-specific pthread-files to honor this change.
|
New version fixes comments by @ethomson. Thanks for your reviews |
Sorry, something went wrong.
|
Thanks again, this is great. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This PR aims to fix the namespacing-issue in issue #3825. The Windows-specific pthreads.c source file tries to re-implement the API exposed by pthreads by implementing many of the pthread-symbols with Windows-specific threading code. This unfortunately results in runtime errors when a user links his application to both libgit2 and winpthreads, causing one of both libraries to override symbols of the other library, causing inconsistencies.
Fix the issue by introducing proper namespacing to our threading API. Instead of trying to re-implement all functions, implement functions inside the git_ namespace and adjust the #defines in Unix-specific code.
This solves the part where linking against both libraries causes runtime errors. What is still missing is to allow Windows-users to link libgit2 not against the internal thread API but against winpthread provided by MinGW/MSYS2. This will follow later either by updating this PR or creating a new one if this one got merged already.