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
index f0e787e37d9384c11d48dbbc35cfb2b1609368e8,8c7b7d09eaae0d5ac1f3d00f5e3bf9ceb92b54de..44ce6bb32b0e98681f7c523537082065e8cb5fc1
@@@ -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
index c7793f50fbe0a43495c2b2d36a47c0b5aac37483,61b153987b0efb9d9c5c53e2a4aa6893a9362f01..2a1041ef6599c84fff6a8d9faf5dea23a2af3ab0
@@@ -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)
  {