PreloadSemaphore class
并发控制信号量 — 实现真正的并发数限制 修复原设计中 maxConcurrentTasks 定义但从未生效的问题
Constructors
- PreloadSemaphore(int maxConcurrent)
Properties
- activeCount → int
-
当前活跃的任务数
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxConcurrent → int
-
最大并发数
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- waitingCount → int
-
当前等待的任务数
no setter
Methods
-
acquire(
) → Future< void> - 获取信号量
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
release(
) → void - 释放信号量
-
reset(
) → void - 重置信号量(清空所有等待)
-
toString(
) → String -
A string representation of this object.
inherited
-
withLock<
T> (Future< T> task()) → Future<T> - 在信号量保护下执行任务
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited