Merge branch 'js/maint-1.6.6-send-pack-stateless-rpc-deadlock-fix' into js/maint-send-pack-stateless-rpc-deadlock-fix

* js/maint-1.6.6-send-pack-stateless-rpc-deadlock-fix:
  send-pack: avoid deadlock when pack-object dies early

Evil merge to adjust the way the use of pthreads in sideband-demultiplexor
was decided (earlier it was "if we are not on Windows", now it is "if we
are not using pthreads").
This commit is contained in:
Junio C Hamano 2011-04-25 15:20:39 -07:00
commit 73776dc1eb

View File

@ -98,6 +98,7 @@ static int pack_objects(int fd, struct ref *refs, struct extra_have_objects *ext
free(buf); free(buf);
close(po.out); close(po.out);
po.out = -1; po.out = -1;
close(fd);
} }
if (finish_command(&po)) if (finish_command(&po))
@ -226,6 +227,9 @@ static void print_helper_status(struct ref *ref)
static int sideband_demux(int in, int out, void *data) static int sideband_demux(int in, int out, void *data)
{ {
int *fd = data; int *fd = data;
#ifdef NO_PTHREADS
close(fd[1]);
#endif
int ret = recv_sideband("send-pack", fd[0], out); int ret = recv_sideband("send-pack", fd[0], out);
close(out); close(out);
return ret; return ret;