attr.c: remove #ifdef NO_PTHREADS
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy committed
Nov 3, 2018 at 09:48 UTC
2e1b141a0132ad3afe2c81e43c4d2c9d394f5b1a
1 file changed
-14
attr.c
-14
@@ -41,23 +41,17 @@ const char *git_attr_name(const struct git_attr *attr)
41
42
struct attr_hashmap {
43
struct hashmap map;
44
-#ifndef NO_PTHREADS
44
pthread_mutex_t mutex;
46
-#endif
45
};
46
47
static inline void hashmap_lock(struct attr_hashmap *map)
48
{
51
-#ifndef NO_PTHREADS
49
pthread_mutex_lock(&map->mutex);
53
-#endif
50
}
51
52
static inline void hashmap_unlock(struct attr_hashmap *map)
53
{
58
-#ifndef NO_PTHREADS
54
pthread_mutex_unlock(&map->mutex);
60
-#endif
55
}
56
57
/*
@@ -498,23 +492,17 @@ static struct check_vector {
492
size_t nr;
493
size_t alloc;
494
struct attr_check **checks;
501
-#ifndef NO_PTHREADS
495
pthread_mutex_t mutex;
503
-#endif
496
} check_vector;
497
498
static inline void vector_lock(void)
499
{
508
-#ifndef NO_PTHREADS
500
pthread_mutex_lock(&check_vector.mutex);
510
-#endif
501
}
502
503
static inline void vector_unlock(void)
504
{
515
-#ifndef NO_PTHREADS
505
pthread_mutex_unlock(&check_vector.mutex);
517
-#endif
506
}
507
508
static void check_vector_add(struct attr_check *c)
@@ -1181,8 +1169,6 @@ void git_all_attrs(const struct index_state *istate,
1169
1170
void attr_start(void)
1171
{
1184
-#ifndef NO_PTHREADS
1172
pthread_mutex_init(&g_attr_hashmap.mutex, NULL);
1173
pthread_mutex_init(&check_vector.mutex, NULL);
1187
-#endif
1174
}