mirror of
https://git.proxmox.com/git/libgit2
synced 2025-07-09 16:06:40 +00:00
Fix bug in the way pthead_mutex_t was being destroyed in win32.
Win32 critical section objects (CRITICAL_SECTION) are not kernel objects. Only kernel objects are destroyed by using CloseHandle. Critical sections are supposed to be deleted with the DeleteCriticalSection API (http://msdn.microsoft.com/en-us/library/ms682552(VS.85).aspx).
This commit is contained in:
parent
cfba137707
commit
16a5c30465
@ -55,9 +55,8 @@ int pthread_mutex_init(pthread_mutex_t *GIT_RESTRICT mutex,
|
|||||||
|
|
||||||
int pthread_mutex_destroy(pthread_mutex_t *mutex)
|
int pthread_mutex_destroy(pthread_mutex_t *mutex)
|
||||||
{
|
{
|
||||||
int ret;
|
DeleteCriticalSection(mutex);
|
||||||
ret = CloseHandle(mutex);
|
return 0;
|
||||||
return -(!ret);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int pthread_mutex_lock(pthread_mutex_t *mutex)
|
int pthread_mutex_lock(pthread_mutex_t *mutex)
|
||||||
|
Loading…
Reference in New Issue
Block a user