diff options
Diffstat (limited to 'src/win32/pthread.h')
-rw-r--r-- | src/win32/pthread.h | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/src/win32/pthread.h b/src/win32/pthread.h index af5b121f0..e4826ca7f 100644 --- a/src/win32/pthread.h +++ b/src/win32/pthread.h @@ -16,13 +16,19 @@ # define GIT_RESTRICT __restrict__ #endif +typedef struct { + HANDLE thread; + void *(*proc)(void *); + void *param; + void *result; +} git_win32_thread; + typedef int pthread_mutexattr_t; typedef int pthread_condattr_t; typedef int pthread_attr_t; typedef int pthread_rwlockattr_t; typedef CRITICAL_SECTION pthread_mutex_t; -typedef HANDLE pthread_t; typedef HANDLE pthread_cond_t; typedef struct { void *Ptr; } GIT_SRWLOCK; @@ -36,13 +42,26 @@ typedef struct { #define PTHREAD_MUTEX_INITIALIZER {(void*)-1} -int pthread_create( - pthread_t *GIT_RESTRICT thread, - const pthread_attr_t *GIT_RESTRICT attr, - void *(*start_routine)(void*), - void *GIT_RESTRICT arg); +int git_win32__thread_create( + git_win32_thread *GIT_RESTRICT, + const pthread_attr_t *GIT_RESTRICT, + void *(*) (void *), + void *GIT_RESTRICT); + +int git_win32__thread_join( + git_win32_thread *, + void **); + +#ifdef GIT_THREADS -int pthread_join(pthread_t, void **); +typedef git_win32_thread git_thread; + +#define git_thread_create(git_thread_ptr, attr, start_routine, arg) \ + git_win32__thread_create(git_thread_ptr, attr, start_routine, arg) +#define git_thread_join(git_thread_ptr, status) \ + git_win32__thread_join(git_thread_ptr, status) + +#endif int pthread_mutex_init( pthread_mutex_t *GIT_RESTRICT mutex, |