]>
Commit | Line | Data |
---|---|---|
bbcc7ffc | 1 | /* |
bb742ede | 2 | * Copyright (C) 2009-2011 the libgit2 contributors |
bbcc7ffc | 3 | * |
bb742ede VM |
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. | |
bbcc7ffc VM |
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; | |
bbcc7ffc VM |
23 | typedef HANDLE pthread_t; |
24 | ||
25 | #define PTHREAD_MUTEX_INITIALIZER {(void*)-1}; | |
26 | ||
27 | int pthread_create(pthread_t *GIT_RESTRICT, | |
87d9869f VM |
28 | const pthread_attr_t *GIT_RESTRICT, |
29 | void *(*start_routine)(void*), void *__restrict); | |
bbcc7ffc VM |
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 | ||
bbcc7ffc VM |
38 | int pthread_num_processors_np(void); |
39 | ||
bb3de0c4 | 40 | #endif |