X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=grep.h;h=fb205f354231c0e50026c6e7fbfae5e288620611;hb=1f5ad6b1a7538d6d489ba97c46455efc0bc3266e;hp=a65280026d5dee8ab059bead79f05d6a1111147a;hpb=b43ba7891422127eb3ec7bd88c9a8ea102b19d0c;p=git.git diff --git a/grep.h b/grep.h index a65280026..fb205f354 100644 --- a/grep.h +++ b/grep.h @@ -8,6 +8,7 @@ typedef int pcre; typedef int pcre_extra; #endif #include "kwset.h" +#include "thread-utils.h" enum grep_pat_token { GREP_PATTERN, @@ -115,6 +116,7 @@ struct grep_opt { int show_hunk_mark; int file_break; int heading; + int use_threads; void *priv; void (*output)(struct grep_opt *opt, const void *data, size_t size); @@ -131,4 +133,12 @@ extern int grep_buffer(struct grep_opt *opt, const char *name, char *buf, unsign extern struct grep_opt *grep_opt_dup(const struct grep_opt *opt); extern int grep_threads_ok(const struct grep_opt *opt); +#ifndef NO_PTHREADS +/* + * Mutex used around access to the attributes machinery if + * opt->use_threads. Must be initialized/destroyed by callers! + */ +extern pthread_mutex_t grep_attr_mutex; +#endif + #endif