]> git.proxmox.com Git - libgit2.git/blob - src/win32/pthread.h
Merge remote-tracking branch 'nulltoken/topic/oid-generation' into development
[libgit2.git] / src / win32 / pthread.h
1 /*
2 * Copyright (C) 2009-2011 the libgit2 contributors
3 *
4 * This file is part of libgit2, distributed under the GNU GPL v2 with
5 * a Linking Exception. For full terms see the included COPYING file.
6 */
7
8 #ifndef GIT_PTHREAD_H
9 #define GIT_PTHREAD_H
10
11 #include "../common.h"
12
13 #if defined (_MSC_VER)
14 # define GIT_RESTRICT __restrict
15 #else
16 # define GIT_RESTRICT __restrict__
17 #endif
18
19 typedef int pthread_mutexattr_t;
20 typedef int pthread_condattr_t;
21 typedef int pthread_attr_t;
22 typedef CRITICAL_SECTION pthread_mutex_t;
23 typedef HANDLE pthread_t;
24
25 #define PTHREAD_MUTEX_INITIALIZER {(void*)-1};
26
27 int pthread_create(pthread_t *GIT_RESTRICT,
28 const pthread_attr_t *GIT_RESTRICT,
29 void *(*start_routine)(void*), void *__restrict);
30
31 int pthread_join(pthread_t, void **);
32
33 int pthread_mutex_init(pthread_mutex_t *GIT_RESTRICT, const pthread_mutexattr_t *GIT_RESTRICT);
34 int pthread_mutex_destroy(pthread_mutex_t *);
35 int pthread_mutex_lock(pthread_mutex_t *);
36 int pthread_mutex_unlock(pthread_mutex_t *);
37
38 int pthread_num_processors_np(void);
39
40 #endif