mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-20 06:56:27 -05:00
thread_pool: use producer token on fast path of enqueue_work_autoscale
The PToken overload of enqueue_work_autoscale passed ptok_ to the blocking fallback enqueue but not to the try_enqueue fast path. BoundedQueue has a try_enqueue(PToken&, ...) overload, so the token was silently ignored on the common (non-full) path, forgoing the per-producer thread-local allocation that moodycamel provides. Pass ptok_ through to try_enqueue so the fast path benefits from the same producer-token locality as the fallback path. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
375f1f9303
commit
2d3528431b
1 changed files with 1 additions and 1 deletions
|
|
@ -1059,7 +1059,7 @@ ThreadPool::enqueue_work_autoscale(ThreadPool::PToken &ptok_,
|
|||
// that could violate this ordering.
|
||||
Func f(std::forward<FuncType>(func_));
|
||||
|
||||
if(_queue.try_enqueue(std::move(f)))
|
||||
if(_queue.try_enqueue(ptok_,std::move(f)))
|
||||
{
|
||||
_tasks_enqueued.fetch_add(1,std::memory_order_relaxed);
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue