Merge branch 'jc/fetch-progressive-stride'

* jc/fetch-progressive-stride:
  Fix potential local deadlock during fetch-pack
This commit is contained in:
Junio C Hamano 2011-03-29 14:09:08 -07:00
Родитель 2eee1393f3 44d8dc54e7
Коммит 96220d837c
1 изменённых файлов: 5 добавлений и 4 удалений

Просмотреть файл

@ -230,16 +230,17 @@ static void insert_alternate_refs(void)
} }
#define INITIAL_FLUSH 16 #define INITIAL_FLUSH 16
#define PIPESAFE_FLUSH 32
#define LARGE_FLUSH 1024 #define LARGE_FLUSH 1024
static int next_flush(int count) static int next_flush(int count)
{ {
if (count < INITIAL_FLUSH * 2) int flush_limit = args.stateless_rpc ? LARGE_FLUSH : PIPESAFE_FLUSH;
count += INITIAL_FLUSH;
else if (count < LARGE_FLUSH) if (count < flush_limit)
count <<= 1; count <<= 1;
else else
count += LARGE_FLUSH; count += flush_limit;
return count; return count;
} }