mirror of
https://github.com/kvcache-ai/ktransformers.git
synced 2026-05-05 07:11:39 +00:00
Rename sync method parameters
This commit is contained in:
parent
d7ab3b41b7
commit
4a9b6cd99e
4 changed files with 15 additions and 10 deletions
|
|
@ -42,7 +42,11 @@ void TaskQueue::enqueue(std::function<void()> task) {
|
|||
prev->next.store(node, std::memory_order_release);
|
||||
}
|
||||
|
||||
void TaskQueue::sync(size_t n) { while (pending.load(std::memory_order_acquire) > n); }
|
||||
void TaskQueue::sync(size_t allow_n_pending) {
|
||||
// Spin until the pending task count drops to the allowed threshold.
|
||||
while (pending.load(std::memory_order_acquire) > allow_n_pending)
|
||||
;
|
||||
}
|
||||
|
||||
void TaskQueue::worker() {
|
||||
Node* curr = head.load(std::memory_order_relaxed);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue