diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-11-18 10:23:52 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-11-18 10:23:52 +0100 |
commit | 26b80a841ad6f2ddff855aa9bd0000a4ba81f6ff (patch) | |
tree | b2e5a385fe3e1825f11fa23de5c09cebe91c70a1 /run-command.c | |
parent | Merge branch 'ds/reachable-topo-order' (diff) | |
parent | Clean up pthread_create() error handling (diff) | |
download | git-26b80a841ad6f2ddff855aa9bd0000a4ba81f6ff.tar.xz git-26b80a841ad6f2ddff855aa9bd0000a4ba81f6ff.zip |
Merge branch 'nd/pthreads'
The codebase has been cleaned up to reduce "#ifndef NO_PTHREADS".
* nd/pthreads:
Clean up pthread_create() error handling
read-cache.c: initialize copy_len to shut up gcc 8
read-cache.c: reduce branching based on HAVE_THREADS
read-cache.c: remove #ifdef NO_PTHREADS
pack-objects: remove #ifdef NO_PTHREADS
preload-index.c: remove #ifdef NO_PTHREADS
grep: clean up num_threads handling
grep: remove #ifdef NO_PTHREADS
attr.c: remove #ifdef NO_PTHREADS
name-hash.c: remove #ifdef NO_PTHREADS
index-pack: remove #ifdef NO_PTHREADS
send-pack.c: move async's #ifdef NO_PTHREADS back to run-command.c
run-command.h: include thread-utils.h instead of pthread.h
thread-utils: macros to unconditionally compile pthreads API
Diffstat (limited to 'run-command.c')
-rw-r--r-- | run-command.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/run-command.c b/run-command.c index d679cc267c..c11ff80674 100644 --- a/run-command.c +++ b/run-command.c @@ -1226,7 +1226,7 @@ int start_async(struct async *async) { int err = pthread_create(&async->tid, NULL, run_thread, async); if (err) { - error_errno("cannot create thread"); + error(_("cannot create async thread: %s"), strerror(err)); goto error; } } @@ -1259,6 +1259,15 @@ int finish_async(struct async *async) #endif } +int async_with_fork(void) +{ +#ifdef NO_PTHREADS + return 1; +#else + return 0; +#endif +} + const char *find_hook(const char *name) { static struct strbuf path = STRBUF_INIT; |