MCPcopy Create free account
hub / github.com/git/git / add_work

Function add_work

builtin/grep.c:110–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108static int skip_first_line;
109
110static void add_work(struct grep_opt *opt, struct grep_source *gs)
111{
112 if (opt->binary != GREP_BINARY_TEXT)
113 grep_source_load_driver(gs, opt->repo->index);
114
115 grep_lock();
116
117 while ((todo_end+1) % ARRAY_SIZE(todo) == todo_done) {
118 pthread_cond_wait(&cond_write, &grep_mutex);
119 }
120
121 todo[todo_end].source = *gs;
122 todo[todo_end].done = 0;
123 strbuf_reset(&todo[todo_end].out);
124 todo_end = (todo_end + 1) % ARRAY_SIZE(todo);
125
126 pthread_cond_signal(&cond_add);
127 grep_unlock();
128}
129
130static struct work_item *get_work(void)
131{

Callers 2

grep_oidFunction · 0.85
grep_fileFunction · 0.85

Calls 4

grep_source_load_driverFunction · 0.85
grep_lockFunction · 0.85
pthread_cond_waitFunction · 0.85
grep_unlockFunction · 0.85

Tested by

no test coverage detected