Merge branch 'js/async-thread'
authorJunio C Hamano <gitster@pobox.com>
Mon, 21 Jun 2010 13:02:45 +0000 (06:02 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 21 Jun 2010 13:02:45 +0000 (06:02 -0700)
* js/async-thread:
  fast-import: die_nicely() back to vsnprintf (reverts part of ebaa79f)
  Enable threaded async procedures whenever pthreads is available
  Dying in an async procedure should only exit the thread, not the process.
  Reimplement async procedures using pthreads
  Windows: more pthreads functions
  Fix signature of fcntl() compatibility dummy
  Make report() from usage.c public as vreportf() and use it.
  Modernize t5530-upload-pack-error.

Conflicts:
http-backend.c

1  2 
compat/mingw.h
compat/win32/pthread.h
git-compat-util.h
http-backend.c
run-command.c

diff --cc compat/mingw.h
Simple merge
Simple merge
Simple merge
diff --cc http-backend.c
@@@ -485,19 -538,12 +485,17 @@@ static void service_rpc(char *service_n
  
  static NORETURN void die_webcgi(const char *err, va_list params)
  {
 -      http_status(500, "Internal Server Error");
 -      hdr_nocache();
 -      end_headers();
 +      static int dead;
  
 -      vreportf("fatal: ", err, params);
 -      exit(0);
 +      if (!dead) {
-               char buffer[1000];
 +              dead = 1;
-               vsnprintf(buffer, sizeof(buffer), err, params);
-               fprintf(stderr, "fatal: %s\n", buffer);
 +              http_status(500, "Internal Server Error");
 +              hdr_nocache();
 +              end_headers();
++
++              vreportf("fatal: ", err, params);
 +      }
 +      exit(0); /* we successfully reported a failure ;-) */
  }
  
  static char* getdir(void)
diff --cc run-command.c
@@@ -79,11 -77,12 +79,12 @@@ static NORETURN void die_child(const ch
        if (len > sizeof(msg))
                len = sizeof(msg);
  
 -      write(child_err, "fatal: ", 7);
 -      write(child_err, msg, len);
 -      write(child_err, "\n", 1);
 +      unused = write(child_err, "fatal: ", 7);
 +      unused = write(child_err, msg, len);
 +      unused = write(child_err, "\n", 1);
        exit(128);
  }
+ #endif
  
  static inline void set_cloexec(int fd)
  {