Skip to content
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

Merged
merged 3 commits into from Aug 15, 2017
Merged

Implement pthread_cond_t with Win32 CONDITION_VARIABLE #1214

merged 3 commits into from Aug 15, 2017

Conversation

rongjiecomputer
Copy link

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 in compat/poll/poll.h are redefined because winsock2.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.

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 <loorongjie@gmail.com>

fast-forwarded.
Signed-off-by: Loo Rong Jie <loorongjie@gmail.com>
@rongjiecomputer
Copy link
Author

See also for bumping bumped _WINNT_VER to 0x600: #1188 (comment)

@rongjiecomputer
Copy link
Author

@dscho Ping?

@@ -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.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

Signed-off-by: Loo Rong Jie <loorongjie@gmail.com>
@dscho dscho merged commit eead5ec into git-for-windows:master Aug 15, 2017
@dscho
Copy link
Member

dscho commented Aug 15, 2017

Thank you so much!

dscho added a commit that referenced this pull request Aug 15, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
dscho added a commit to git-for-windows/build-extra that referenced this pull request Aug 16, 2017
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 <johannes.schindelin@gmx.de>
dscho added a commit that referenced this pull request Aug 18, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
git-for-windows-ci pushed a commit that referenced this pull request Aug 18, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
git-for-windows-ci pushed a commit that referenced this pull request Aug 20, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
dscho added a commit that referenced this pull request Aug 22, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
git-for-windows-ci pushed a commit that referenced this pull request Aug 23, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
git-for-windows-ci pushed a commit that referenced this pull request Aug 24, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
git-for-windows-ci pushed a commit that referenced this pull request Aug 24, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
git-for-windows-ci pushed a commit that referenced this pull request Aug 24, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
git-for-windows-ci pushed a commit that referenced this pull request Aug 24, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
git-for-windows-ci pushed a commit that referenced this pull request Aug 25, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
git-for-windows-ci pushed a commit that referenced this pull request Aug 25, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
dscho added a commit that referenced this pull request Aug 26, 2017
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
dscho added a commit that referenced this pull request Mar 23, 2018
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
dscho added a commit that referenced this pull request Apr 3, 2018
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
dscho added a commit that referenced this pull request May 29, 2018
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
dscho added a commit that referenced this pull request May 29, 2018
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
PKRoma pushed a commit to PKRoma/git-for-windows that referenced this pull request Jun 22, 2018
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
PKRoma pushed a commit to PKRoma/git-for-windows that referenced this pull request Jun 22, 2018
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
PKRoma pushed a commit to PKRoma/git-for-windows that referenced this pull request Jun 22, 2018
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
dscho added a commit that referenced this pull request Aug 22, 2018
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
dscho added a commit to dscho/git that referenced this pull request Aug 22, 2018
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
dscho added a commit that referenced this pull request Aug 23, 2018
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
dscho added a commit that referenced this pull request Aug 23, 2018
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
dscho added a commit that referenced this pull request Aug 23, 2018
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
jamill pushed a commit to jamill/git that referenced this pull request Aug 28, 2018
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
jamill pushed a commit to jamill/git that referenced this pull request Sep 5, 2018
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
git-for-windows-ci pushed a commit that referenced this pull request Sep 10, 2018
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
jamill pushed a commit to jamill/git that referenced this pull request Sep 11, 2018
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
git-for-windows-ci pushed a commit that referenced this pull request Sep 24, 2018
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
dscho added a commit that referenced this pull request Oct 10, 2018
Implement pthread_cond_t with Win32 CONDITION_VARIABLE
dscho added a commit to dscho/git that referenced this pull request Oct 11, 2018
This was pull request git-for-windows#1214 from rongjiecomputer/master

Implement pthread_cond_t with Win32 CONDITION_VARIABLE

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit to dscho/git that referenced this pull request Nov 19, 2018
This was pull request git-for-windows#1214 from rongjiecomputer/master

Implement pthread_cond_t with Win32 CONDITION_VARIABLE

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit that referenced this pull request Nov 21, 2018
This was pull request #1214 from rongjiecomputer/master

Implement pthread_cond_t with Win32 CONDITION_VARIABLE

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants