mirror of
https://github.com/git/git.git
synced 2026-04-01 12:30:09 +02:00
Revert "[PATCH] fix threaded grep for machines with only one cpu"
This reverts commit 2539a7bdb8.
This commit is contained in:
@@ -220,6 +220,12 @@ static void start_threads(struct grep_opt *opt)
|
||||
{
|
||||
int i;
|
||||
|
||||
pthread_mutex_init(&grep_mutex, NULL);
|
||||
pthread_mutex_init(&read_sha1_mutex, NULL);
|
||||
pthread_cond_init(&cond_add, NULL);
|
||||
pthread_cond_init(&cond_write, NULL);
|
||||
pthread_cond_init(&cond_result, NULL);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(todo); i++) {
|
||||
strbuf_init(&todo[i].out, 0);
|
||||
}
|
||||
@@ -874,12 +880,6 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
|
||||
if (online_cpus() == 1 || !grep_threads_ok(&opt))
|
||||
use_threads = 0;
|
||||
|
||||
pthread_mutex_init(&grep_mutex, NULL);
|
||||
pthread_mutex_init(&read_sha1_mutex, NULL);
|
||||
pthread_cond_init(&cond_add, NULL);
|
||||
pthread_cond_init(&cond_write, NULL);
|
||||
pthread_cond_init(&cond_result, NULL);
|
||||
|
||||
if (use_threads)
|
||||
start_threads(&opt);
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user