}
/* Protect access to object database */
-static pthread_mutex_t read_mutex;
-#define read_lock() pthread_mutex_lock(&read_mutex)
-#define read_unlock() pthread_mutex_unlock(&read_mutex)
+#define read_lock() packing_data_read_lock(&to_pack)
+#define read_unlock() packing_data_read_unlock(&to_pack)
/* Protect delta_cache_size */
static pthread_mutex_t cache_mutex;
*/
static void init_threaded_search(void)
{
- init_recursive_mutex(&read_mutex);
pthread_mutex_init(&cache_mutex, NULL);
pthread_mutex_init(&progress_mutex, NULL);
pthread_cond_init(&progress_cond, NULL);
{
set_try_to_free_routine(old_try_to_free_routine);
pthread_cond_destroy(&progress_cond);
- pthread_mutex_destroy(&read_mutex);
pthread_mutex_destroy(&cache_mutex);
pthread_mutex_destroy(&progress_mutex);
}
1UL << OE_DELTA_SIZE_BITS);
#ifndef NO_PTHREADS
pthread_mutex_init(&pdata->lock, NULL);
+ init_recursive_mutex(&pdata->read_lock);
#endif
}
struct packed_git **in_pack;
pthread_mutex_t lock;
+ pthread_mutex_t read_lock;
/*
* This list contains entries for bases which we know the other side
pthread_mutex_unlock(&pdata->lock);
}
+static inline void packing_data_read_lock(struct packing_data *pdata)
+{
+ pthread_mutex_lock(&pdata->read_lock);
+}
+static inline void packing_data_read_unlock(struct packing_data *pdata)
+{
+ pthread_mutex_unlock(&pdata->read_lock);
+}
+
struct object_entry *packlist_alloc(struct packing_data *pdata,
const unsigned char *sha1,
uint32_t index_pos);