fix unlock_early() usages

This commit is contained in:
Lunaphied 2026-04-10 20:43:33 +02:00
parent 18f5a4b754
commit 2ea3296595
2 changed files with 4 additions and 4 deletions

View File

@ -177,7 +177,7 @@ class HeAPPlacer
{
auto startt = std::chrono::high_resolution_clock::now();
std::lock_guard<Context> lock{*ctx};
std::unique_lock<Context> lock{*ctx};
place_constraints();
build_fast_bels();
alloc_control_sets();
@ -396,7 +396,7 @@ class HeAPPlacer
}
ctx->check();
lock.unlock_early();
lock.unlock();
#if !defined(NPNR_DISABLE_THREADS)
if (cfg.parallelRefine) {

View File

@ -1680,7 +1680,7 @@ struct Router2
ThreadContext st;
int iter = 1;
std::lock_guard<Context> lock{*ctx};
std::unique_lock<Context> lock{*ctx};
for (size_t i = 0; i < nets_by_udata.size(); i++)
route_queue.push_back(i);
@ -1797,7 +1797,7 @@ struct Router2
log_info("Running router1 to check that route is legal...\n");
lock.unlock_early();
lock.unlock();
router1(ctx, Router1Cfg(ctx));
}