-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Implement pthread_cond_t with Win32 CONDITION_VARIABLE #1214
Conversation
Win32 CONDITION_VARIABLE has better performance and is easier to maintain. Since CONDITION_VARIABLE is not available in Windows XP and below, old implementation of pthread_cond_t is kept under define guard 'GIT_WIN_XP_SUPPORT'. To enable old implementation, build with make CFLAGS="-DGIT_WIN_XP_SUPPORT". Signed-off-by: Loo Rong Jie <[email protected]> fast-forwarded.
Signed-off-by: Loo Rong Jie <[email protected]>
See also for bumping bumped |
@dscho Ping? |
compat/win32/pthread.c
Outdated
@@ -57,6 +57,8 @@ pthread_t pthread_self(void) | |||
return t; | |||
} | |||
|
|||
#ifdef GIT_WIN_XP_SUPPORT |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Signed-off-by: Loo Rong Jie <[email protected]>
Thank you so much! |
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
The XP-compatibility layer emulating pthreads (which is [no longer needed](https://git-for-windows.github.io/requirements.html) [was dropped in favor of modern Windows threading APIs](git-for-windows/git#1214); This should make threaded operations slightly faster and more robust. Signed-off-by: Johannes Schindelin <[email protected]>
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
This was pull request git-for-windows#1214 from rongjiecomputer/master Implement pthread_cond_t with Win32 CONDITION_VARIABLE Signed-off-by: Johannes Schindelin <[email protected]>
This was pull request git-for-windows#1214 from rongjiecomputer/master Implement pthread_cond_t with Win32 CONDITION_VARIABLE Signed-off-by: Johannes Schindelin <[email protected]>
This was pull request #1214 from rongjiecomputer/master Implement pthread_cond_t with Win32 CONDITION_VARIABLE Signed-off-by: Johannes Schindelin <[email protected]>
Win32 CONDITION_VARIABLE has better performance and is easier to maintain.
Since CONDITION_VARIABLE is not available in Windows XP and below, old implementation of pthread_cond_t is kept under define guard 'GIT_WIN_XP_SUPPORT'. To enable old implementation, build with
make CFLAGS="-DGIT_WIN_XP_SUPPORT"
.If I build with
make CFLAGS="-D_WIN32_WINNT=0x0600
or change the define in git-compat-util.h, I will get many warnings and errors about symbols incompat/poll/poll.h
are redefined becausewinsock2.h
define them already when_WIN32_WINNT=0x0600
.I choose the simpler solution: keep the old _WIN32_WINNT and declare the 4 required Win32 functions in
pthread.c
.