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

Function get_work

builtin/grep.c:130–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128}
129
130static struct work_item *get_work(void)
131{
132 struct work_item *ret;
133
134 grep_lock();
135 while (todo_start == todo_end && !all_work_added) {
136 pthread_cond_wait(&cond_add, &grep_mutex);
137 }
138
139 if (todo_start == todo_end && all_work_added) {
140 ret = NULL;
141 } else {
142 ret = &todo[todo_start];
143 todo_start = (todo_start + 1) % ARRAY_SIZE(todo);
144 }
145 grep_unlock();
146 return ret;
147}
148
149static void work_done(struct work_item *w)
150{

Callers 1

runFunction · 0.85

Calls 3

grep_lockFunction · 0.85
pthread_cond_waitFunction · 0.85
grep_unlockFunction · 0.85

Tested by

no test coverage detected