summaryrefslogtreecommitdiff
path: root/src/win32
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-04-16 14:19:27 -0700
committerVicent Marti <tanoku@gmail.com>2013-04-22 16:52:07 +0200
commit38eef6113d8523abfe6746bf727cee2651398ad3 (patch)
tree3565c7cacc968d8ddf05a8c551e3202a7a08436c /src/win32
parentc628918625c7f779d2050a56998fb2b675f097fb (diff)
downloadlibgit2-38eef6113d8523abfe6746bf727cee2651398ad3.tar.gz
Make indexer use shared packfile open code
The indexer was creating a packfile object separately from the code in pack.c which was a problem since I put a call to git_mutex_init into just pack.c. This commit updates the pack function for creating a new pack object (i.e. git_packfile_check()) so that it can be used in both places and then makes indexer.c use the shared initialization routine. There are also a few minor formatting and warning message fixes.
Diffstat (limited to 'src/win32')
-rw-r--r--src/win32/pthread.c5
-rw-r--r--src/win32/pthread.h11
2 files changed, 10 insertions, 6 deletions
diff --git a/src/win32/pthread.c b/src/win32/pthread.c
index c78213f15..232709e54 100644
--- a/src/win32/pthread.c
+++ b/src/win32/pthread.c
@@ -33,8 +33,9 @@ int pthread_join(pthread_t thread, void **value_ptr)
return -1;
}
-int pthread_mutex_init(pthread_mutex_t *GIT_RESTRICT mutex,
- const pthread_mutexattr_t *GIT_RESTRICT mutexattr)
+int pthread_mutex_init(
+ pthread_mutex_t *GIT_RESTRICT mutex,
+ const pthread_mutexattr_t *GIT_RESTRICT mutexattr)
{
GIT_UNUSED(mutexattr);
InitializeCriticalSection(mutex);
diff --git a/src/win32/pthread.h b/src/win32/pthread.h
index a219a0137..8277ecf6e 100644
--- a/src/win32/pthread.h
+++ b/src/win32/pthread.h
@@ -25,13 +25,16 @@ typedef HANDLE pthread_cond_t;
#define PTHREAD_MUTEX_INITIALIZER {(void*)-1};
-int pthread_create(pthread_t *GIT_RESTRICT,
- const pthread_attr_t *GIT_RESTRICT,
- void *(*start_routine)(void*), void *__restrict);
+int pthread_create(
+ pthread_t *GIT_RESTRICT,
+ const pthread_attr_t *GIT_RESTRICT,
+ void *(*start_routine)(void*),
+ void *__restrict);
int pthread_join(pthread_t, void **);
-int pthread_mutex_init(pthread_mutex_t *GIT_RESTRICT, const pthread_mutexattr_t *GIT_RESTRICT);
+int pthread_mutex_init(
+ pthread_mutex_t *GIT_RESTRICT, const pthread_mutexattr_t *GIT_RESTRICT);
int pthread_mutex_destroy(pthread_mutex_t *);
int pthread_mutex_lock(pthread_mutex_t *);
int pthread_mutex_unlock(pthread_mutex_t *);