Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
edolstra committed Jan 15, 2025
1 parent 4bf9371 commit b23ef1b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
7 changes: 3 additions & 4 deletions src/libfetchers/git-utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1152,12 +1152,10 @@ struct GitFileSystemObjectSinkImpl : GitFileSystemObjectSink
}
}

ThreadPool workers2{concurrency};

auto & root = _state.lock()->root;

processGraph<Directory *>(
workers2,
//workers2,
{&root},
[&](Directory * const & node) -> std::set<Directory *>
{
Expand Down Expand Up @@ -1188,7 +1186,8 @@ struct GitFileSystemObjectSinkImpl : GitFileSystemObjectSink
throw Error("creating a tree object: %s", git_error_last()->message);
node->oid = oid;
},
true);
true,
concurrency);

#if 0
repo->flush();
Expand Down
9 changes: 5 additions & 4 deletions src/libutil/thread-pool.hh
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ void processGraph(
const std::set<T> & nodes,
std::function<std::set<T>(const T &)> getEdges,
std::function<void(const T &)> processNode,
bool discoverNodes = false)
bool discoverNodes = false,
size_t maxThreads = 0)
{
struct Graph {
std::set<T> known;
Expand All @@ -98,9 +99,9 @@ void processGraph(

std::function<void(const T &)> worker;

/* Create pool last to ensure threads are stopped before other destructors
* run */
ThreadPool pool;
/* Create pool last to ensure threads are stopped before other
destructors run. */
ThreadPool pool(maxThreads);

worker = [&](const T & node) {

Expand Down

0 comments on commit b23ef1b

Please sign in to comment.